A streaming AI chat workspace and agent built on a plain JavaScript frontend and a Flask backend proxying NVIDIA inference and Supabase storage.
Bimo is an open-source AI chat app and agent workspace. It streams responses token by token over Server-Sent Events, renders Markdown, code blocks, and math formulas as they arrive, and supports image generation, document parsing, and voice interaction.
The browser client uses HTML, CSS, and plain ES modules without build tools, frameworks, or bundlers. The backend is a Flask gateway that authenticates Supabase user tokens, enforces rate limits, and routes inference to NVIDIA endpoints.
- Passwordless authentication: Sign in with Google through Supabase OAuth. Tokens are verified using ES256 JWTs against project JWKS keys.
- Live streaming: Responses stream using Server-Sent Events with inline Markdown, syntax-highlighted code blocks, and KaTeX rendering.
- Model routing: Switch between fast answers (Aeon 2.0), coding and math (Stanza 2.0), deep reasoning (Nexos 3.0), and image generation (Iris 1.0).
- Document parsing: Drop in PDF, DOCX, XLSX, PPTX, or ZIP files to extract text and analyze contents.
- Vision processing: Attach images to route prompts to a vision model.
- Voice assistant: Speech to text and text to speech powered by NVIDIA Riva.
- Server cancellation: Stopping a response halts generation on the server immediately using an internal stream registry.
Google OAuth
Browser ───────────────────────────────> Supabase Auth
│ <─────────────── ES256 JWT ──────────────┘
│
│ Authorization: Bearer <jwt>
▼
┌──────────────────────────────────────────────────────────┐
│ Flask gateway │
│ • Verifies JWTs against Supabase JWKS │
│ • Enforces row-level security with service-role key │
│ • Controls SSE token streams and cancellation │
└──────────────────────────────────────────────────────────┘
│ │ │
▼ ▼ ▼
Supabase Supabase NVIDIA endpoints
Postgres Storage • Chat (SSE)
(RLS) (Signed URLs) • Vision & Images
• Riva ASR & TTS
Python 3.11+, a Supabase account, and an NVIDIA API key.
Run the SQL scripts in backend/migrations/ in numerical order inside your Supabase project SQL editor.
cd backend
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
python -m app.mainVerify the server with curl http://localhost:8000/health.
cd frontend
python -m http.server 5500Open http://localhost:5500 in your browser. Configure your Supabase URL and backend origin in Settings.
BIMO/
├── backend/
│ ├── app/
│ │ ├── main.py Flask gateway, streaming routes, model map
│ │ ├── auth.py JWT and JWKS authentication verification
│ │ ├── store.py Postgres and Storage data operations
│ │ ├── nvidia_client.py Inference wrapper for OpenAI SDK and NIM
│ │ ├── riva_transcribe.py Riva speech-to-text integration
│ │ ├── riva_tts.py Riva text-to-speech integration
│ │ ├── document_processor.py File parser for PDF, DOCX, XLSX, PPTX, ZIP
│ │ └── analytics.py Usage metrics calculation
│ ├── migrations/ SQL schema and security policies
│ └── tests/ Backend unit and API tests
├── frontend/
│ ├── index.html Single-page application markup
│ ├── css/styles.css CSS tokens and component layout
│ └── js/ Plain ES module components
├── render.yaml Render deployment configuration
└── vercel.json Vercel frontend configuration
- No direct database access: Requests route through the Flask gateway, which checks identity before accessing data.
- Row level security: Supabase Postgres rules restrict row access to the owning user ID.
- Server secrets: Service role keys and NVIDIA API keys stay on the backend server.
- Token verification: ES256 tokens validate against project JWKS keys on every request.
Run tests with pytest:
cd backend
pytest -vReleased under the MIT License. Copyright (c) Saim Shafique.