Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bimo logo Bimo

A streaming AI chat workspace and agent built on a plain JavaScript frontend and a Flask backend proxying NVIDIA inference and Supabase storage.

Live demo License: MIT GitHub stars GitHub forks Issues Python Flask

Live demo | Report an issue


What is Bimo

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.

Explainer video

Watch Explainer Video


Features

  • 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.

System architecture

                     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

Quick start

Prerequisites

Python 3.11+, a Supabase account, and an NVIDIA API key.

1. Database setup

Run the SQL scripts in backend/migrations/ in numerical order inside your Supabase project SQL editor.

2. Start the backend

cd backend
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
python -m app.main

Verify the server with curl http://localhost:8000/health.

3. Start the frontend

cd frontend
python -m http.server 5500

Open http://localhost:5500 in your browser. Configure your Supabase URL and backend origin in Settings.

Project structure

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

Security

  1. No direct database access: Requests route through the Flask gateway, which checks identity before accessing data.
  2. Row level security: Supabase Postgres rules restrict row access to the owning user ID.
  3. Server secrets: Service role keys and NVIDIA API keys stay on the backend server.
  4. Token verification: ES256 tokens validate against project JWKS keys on every request.

Testing

Run tests with pytest:

cd backend
pytest -v

License

Released under the MIT License. Copyright (c) Saim Shafique.

About

Introducing Bimo 5 (Autonomous Multi-Modal AI Agent with real-time voice, vision processing, document analysis, image generation, and web search).

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages