Inspiration

What it does

How we built it

Challenges we ran into

Accomplishments that## Inspiration

The primary inspiration for Ambulance-Asha 2.0 stems from a critical concept in emergency medicine known as "The Golden Hour"—the first 60 minutes after a traumatic injury where rapid, accurate medical intervention represents the thin line between life and death.

During natural disasters (earthquakes, floods, hurricanes), high-altitude rescues, or remote wilderness operations, cellular networks are often the first infrastructure to fail. In congested urban environments, network gridlock can also sever communications. When paramedics operate in these disconnected edge conditions, they are completely cut off from expert medical advice, leaving them to make high-stakes clinical triage decisions completely alone under immense pressure.

We wanted to build a fully self-contained, offline-first clinical supervisor that resides directly in the ambulance or disaster backpack. Inspired by the Sanskrit/Hindi word "Asha" (meaning "Hope"), we envisioned a beacon of clinical intelligence that functions perfectly anywhere on Earth—completely offline, private, and running entirely on standard paramedic field laptops.


What it does

Ambulance-Asha 2.0 is an offline-capable, dual-model hybrid-edge AI triage assistant designed for resource-constrained, remote, and disconnected emergency environments. It works 100% locally on paramedic laptops or rugged tablets with zero cloud dependencies and absolute data privacy.

  • 100% Offline Speech-to-Text: Paramedics record speech reports natively via the HTML5 MediaRecorder API. A local backend runs an ultra-fast, C++ optimized faster-whisper (tiny) model that transcribes medical reports in real-time without internet access.
  • Sub-Second Edge Triage: A lightweight edge model (gemma4:e2b at 2.6B parameters) processes the paramedic’s verbal description in under 250–500ms, categorizing the patient into standardized clinical emergency priorities (RED: Immediate, YELLOW: Urgent, GREEN: Delayed, BLACK: Deceased).
  • Native Local Tool Calling: If the triage priority is determined to be RED or YELLOW, gemma4:e2b automatically executes a local mock function call (alert_hospital). This automatically alerts incoming trauma centers, reserves ER beds, and schedules clinical standby teams before the ambulance even arrives.
  • Deep Specialist Protocol: For highly complex trauma cases, paramedics can request a deep consult with a single tap. This activates a flagship local reasoning model (gemma4:26b at 26B parameters) to generate highly detailed, step-by-step clinical protocols, identify anatomical risks (e.g., tension pneumothorax), and highlight specific vital parameters to monitor immediately.
  • Sleek Pulse HUD Dashboard: A stunning, glassmorphic dark-mode interface optimized for high-stress night shifts. It features dynamic latency metric tracking, a Siri-style procedural canvas waveform visualizer, and an interactive patient triage log.

How we built it

We designed Ambulance-Asha 2.0 from the ground up using a modern, performant, and completely offline technical stack:

  1. Frontend: A premium Next.js 16 (React 19) dashboard styled with Tailwind CSS and animated using Framer Motion. The interface utilizes glassmorphism, glowing telemetry states, and CSS pulsing indicators for immediate visual comprehension under pressure.
  2. Siri-Style Audio Visualization: We drew a beautiful 60fps procedural soundwave visualizer directly on an HTML5 <canvas> element using simulated frequencies. This provides interactive visual feedback during voice recording without locking the system's microphone device, completely bypassing hardware lock conflicts.
  3. FastAPI Backend: A lightweight, high-velocity FastAPI server handles CORS middleware routing, local file handling, and model orchestration.
  4. Local Speech Processing: We bypassed cloud speech APIs entirely, integrating a C++ optimized local faster-whisper wrapper using Python.
  5. Local LLM Orchestration via Ollama: We leveraged Ollama to orchestrate our dual-model hybrid architecture:
    • The Sprinter (gemma4:e2b): Loaded into VRAM for ultra-low latency, real-time voice triage, and JSON function calling.
    • The Specialist (gemma4:26b): Loaded on-demand or running on a managed queue to handle deep clinical reasoning, multi-step diagnostics, and advanced treatment guides.

Challenges we ran into

  • VRAM Constraints & Model Concurrency: Keeping both a 26B parameter model (~17GB) and a 2.6B parameter model (~7.2GB) hot in GPU memory simultaneously is extremely demanding for standard consumer-grade field laptops.
    • Solution: We configured Ollama’s concurrency limits and designed a robust, asynchronous request-queue handler in our Python backend. gemma4:e2b remains persistently in VRAM for real-time speech telemetry, while gemma4:26b operates on a lazy-loading queue. We implemented a sequential fallback mechanism to automatically swap models or offload layers to system RAM if VRAM is fully exhausted, preventing application crashes.
  • Offline Audio Pipeline & Hardware Contention: Default browser-based speech recognition requires constant internet connectivity to hit external servers and locks the recording driver, making concurrent real-time audio visualization impossible.
    • Solution: We designed a native offline audio pipeline. We record audio segments natively in the browser as WebM blobs, post them to our FastAPI backend, and decode them locally with faster-whisper (tiny), guaranteeing 100% offline accuracy and eliminating microphone channel locks.
  • Structured Output from Small Edge Models: Compact models like gemma4:e2b can sometimes struggle with JSON formatting or fail to execute function calls under complex system prompts.
    • Solution: We engineered highly strict, defensive system prompts with explicit few-shot examples and reinforced the backend with regex-based parser fallbacks. If the model fails to return clean JSON, the Python parser extracts priority tokens (e.g., "Priority: RED") directly from the raw text to trigger the hospital alert protocol seamlessly.

Accomplishments that we're proud of

  • True 100% Offline Autonomy: Successfully built a premium, state-of-the-art medical emergency assistant that functions perfectly with zero cloud connections, making it viable in remote mountain ranges, subways, or major natural disaster zones.
  • Zero Operating Costs & High Scalability: By shifting from commercial LLM APIs to free, local, open-weights Gemma 4 models, we reduced the per-run API cost to exactly zero. This makes the system infinitely scalable for underfunded volunteer rescue teams and municipal ambulance fleets.
  • Absolute Data Privacy: Keeping all sensitive patient telemetry and clinical conversations 100% local on the edge hardware removes any danger of data breaches and satisfies strict medical confidentiality principles without expensive cloud compliance setups.
  • Stunning User Experience: Created a high-end, immersive, dark glassmorphic medical HUD that is both highly functional and visually breathtaking, making it stand out as a top-tier software solution.

What we learned

  • The Power of Hybrid Edge: You don't need a single massive model to do everything. Coordinating a fast, lightweight edge model (gemma4:e2b) for front-end tasks alongside a large flagship reasoning model (gemma4:26b) on an as-needed basis is a highly efficient design pattern that saves immense computing resources while maintaining premium speed and depth.
  • Optimized Local Speech is Incredibly Viable: Tiny local models like faster-whisper can perform speech-to-text with exceptional accuracy and near-zero latency, proving that the cloud is no longer a hard requirement for fluid voice UI.
  • Defensive Engineering is Essential for Edge AI: Edge-native applications must treat LLM outputs as highly unpredictable. Building fallback regular expression parsers, retry loops, and error-handling layers in the backend is vital to creating a bulletproof application.

What's next for Ambulance Asha

  • Offline Multimodal Image Diagnostics: Integrate local vision-capable edge models, allowing paramedics to snap offline photos of wounds, burns, pupil responses, or ECG printouts to receive instantaneous diagnostic assessments.
  • Direct Bluetooth Sensor Integration: Connect Ambulance-Asha directly to local medical hardware (e.g., Bluetooth pulse oximeters, ECG monitors, blood pressure cuffs) to feed real-time patient telemetry straight into the HUD dashboard without manual input.
  • Offline RAG for Regional Protocols: Integrate an offline Vector Database preloaded with specific state, county, or pediatric clinical guidelines, ensuring that Asha's reasoning model grounds its treatment protocols in the exact local regulations of the active response jurisdiction.
  • Multi-lingual Speech Support: Expand Whisper's translation capabilities and optimize prompts to support regional languages and dialects, making Ambulance-Asha accessible to remote, indigenous, and international emergency response teams around the world. we're proud of

What we learned

What's next for Ambulance Asha

Built With

Share this project:

Updates