Fetching latest headlines…
Gemma 4 as Your Personal Planetarium Guide
NORTH AMERICA
πŸ‡ΊπŸ‡Έ United Statesβ€’May 10, 2026

Gemma 4 as Your Personal Planetarium Guide

1 views0 likes0 comments
Originally published byDev.to

This is a submission for the Gemma 4 Challenge: Build with Gemma 4

What I Built

StarLens β€” an AI-powered night sky companion where Gemma 4 is the protagonist, not a bolt-on.

StarLens computes the real-time positions of 118,000 stars, 8 planets, the Sun, and Moon using NASA/JPL ephemeris data (Skyfield + Hipparcos catalog), then feeds that data into Gemma 4 so every answer is grounded in actual science β€” not hallucination.

It features 7 interactive tabs, each showcasing a different Gemma 4 capability:

  • 🌌 Tonight's Sky β€” Real-time sky map with Gemma narration. Tap any object and ask "Why is it there?" β€” Gemma explains the orbital mechanics.
  • πŸ’¬ Sky Chat β€” Multi-turn conversation with the full sky state injected as context. Ask "What's that bright thing in the south?" and Gemma looks up the real computed positions.
  • πŸš€ Guided Tour β€” Gemma leads you through the sky step-by-step with exact directions, altitudes, and surprising facts β€” like a live planetarium show.
  • πŸ”„ Sky Comparison β€” Side-by-side charts showing how the sky transforms over 1-12 hours, with Gemma narrating what rises, sets, and shifts.
  • πŸ“Έ Photo Identification β€” Upload a night sky photo and Gemma's vision identifies constellations, stars, and planets β€” then the engine cross-validates against computed ephemeris positions.
  • πŸ” Deep Dive β€” Ask about any celestial object. Gemma receives the full star catalog via its 128K context window for comprehensive explanations.
  • πŸ“‹ Observation Planner β€” Gemma creates an optimized stargazing plan with best times, viewing order, and photography tips.

The multimodal round-trip is the highlight: StarLens renders a sky chart from ephemeris data, then feeds it back to Gemma 4's vision model for analysis β€” proving Gemma can both consume and reason about astronomical visualizations.

Demo

🎬 Watch the full demo (2:30)

StarLens Demo

Code

GitHub logo imjoseangel / starlens

πŸ”­ AI night sky companion powered by Gemma 4 β€” real-time star charts, photo identification, guided tours, and observation planning via Gradio + Skyfield

πŸ”­ StarLens β€” Gemma 4 Night Sky Companion

Your AI-powered stargazing assistant where Gemma 4 is the protagonist β€” identifying, narrating, guiding, reasoning, and conversing about the sky, all grounded in real NASA/JPL ephemeris data.

StarLens doesn't just "use" Gemma 4 β€” every feature flows through Gemma's intelligence. It's not a sky app with AI bolted on; it's an AI astronomy companion that happens to know the real positions of every object above you.

StarLens Python Gradio

StarLens Demo

Why Gemma 4?

StarLens showcases 7 distinct Gemma 4 capabilities β€” more than any other feature uses in isolation:

Gemma 4 Capability How StarLens Uses It
Multimodal Vision Identify objects in uploaded sky photos AND analyze rendered sky charts (round-trip)
128K Context Window Load the entire Hipparcos star catalog for deep astronomical reasoning
Multi-Turn Conversation Interactive sky chat with full ephemeris context β€” ask anything about what's above you
Structured Reasoning "Why is this object here?"
…

How I Used Gemma 4

StarLens exercises 7 distinct Gemma 4 capabilities through 9 specialized methods:

Capability Method Model Why
Multimodal Vision identify_sky(), analyze_chart() gemma4:e4b Fast image analysis for photo ID and chart round-trip
128K Context Window explain_object() gemma4:31b-cloud Loads the entire Hipparcos star catalog for deep reasoning
Multi-Turn Chat chat() gemma4:31b-cloud Conversational sky Q&A with ephemeris as system context
Structured Reasoning explain_why() gemma4:31b-cloud Orbital mechanics and celestial geometry explanations
Narrative Generation guided_tour(), narrate_sky() gemma4:31b-cloud Step-by-step tours and engaging sky descriptions
Temporal Reasoning compare_skies() gemma4:31b-cloud Narrates how the sky transforms over hours
Cross-Validation identify_sky() + engine gemma4:e4b AI identifications checked against real ephemeris positions

Why these models?

  • gemma4:e4b for vision tasks β€” it's fast enough for interactive photo analysis and the multimodal round-trip where latency matters.
  • gemma4:31b-cloud for reasoning β€” the 128K context window is essential for loading full star catalogs, and the deeper reasoning produces better tour narrations and orbital mechanics explanations.

Users can switch models from the sidebar based on their hardware β€” all 9 methods respect the selection dynamically.

Architecture

The key insight is context injection: every Gemma call receives real computed astronomical data as context, so Gemma reasons from science, not training data. The engine layer orchestrates catalog computations and Gemma calls, cross-validates results, and builds the context that makes Gemma's answers accurate.

Built with Python, Gradio, Skyfield, Ollama, and pydantic-settings. Optional Redis caching and Docker deployment included.

Comments (0)

Sign in to join the discussion

Be the first to comment!