Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

316 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bimo — open-source streaming AI chat workspace

Bimo · Open-Source Streaming AI Chat Workspace

A self-hostable, ChatGPT-style AI chat app with live token streaming, a Claude-inspired UI, image generation, vision, document understanding, and a hands-free voice assistant — built on a vanilla-JavaScript frontend (no build step) and a Python/Flask streaming gateway over NVIDIA models.

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

Live demo · Report a bug · Request a feature


What is Bimo?

Bimo is an open-source AI chat workspace — a self-hostable alternative to ChatGPT and Claude that you run on your own Supabase project and inference keys. It streams responses token-by-token over Server-Sent Events, renders Markdown, syntax-highlighted code and LaTeX math as the model types, and ships with multi-model switching, image generation, image and document understanding, and a real-time voice assistant.

The frontend is plain HTML, CSS and JavaScript with zero build tooling — no React, no bundler, no transpiler — so it deploys to any static host and stays trivial to read and fork. The backend is a thin Flask gateway that verifies Supabase JWTs and proxies inference to NVIDIA's OpenAI-compatible endpoints, keeping every key server-side and every database row protected by Postgres row-level security.

Why "gateway"? The browser never talks to the database or the model provider directly. All traffic flows through the Flask service, which validates the user's identity, enforces per-user access, and streams tokens back — so a leaked anon key can never read another user's data.

Table of contents

Features

  • 🔐 Passwordless auth — one-click Google sign-in via Supabase OAuth; tokens are ES256 JWTs verified against the project JWKS.
  • Live streaming — responses render token-by-token over SSE, with Markdown, syntax-highlighted code blocks, and KaTeX math rendered as they arrive.
  • 🧠 Multiple models, one chat — switch per conversation between a fast lane, a coding/math model, and a deep-reasoning model (see Models).
  • 🎨 Image generation — describe an image and Bimo generates it inline (FLUX).
  • 👁️ Vision — attach screenshots or photos and ask questions about them; image turns auto-route to a vision model.
  • 📄 Document understanding — drop in PDF, DOCX, XLSX or PPTX files and chat over their contents.
  • 🎙️ Voice assistant — fully hands-free: speak to Bimo and hear it answer back (NVIDIA Riva ASR + TTS).
  • 🌗 Dark & light themes — token-based theming with no flash-of-wrong-theme on load.
  • 🧭 Guided onboarding — a one-time "what's new" flow with a lightweight profile survey.
  • 🐛 Feedback & bug reports — an in-app channel that reaches the maintainer directly.
  • 📱 Responsive — a persistent sidebar on desktop and a drawer on mobile.

Models

Bimo surfaces a small set of friendly model names in the UI and maps each to a production-grade open model behind the gateway. Swap models from Render → Environment (no code change):

Env var UI name
NVIDIA_AEON_MODEL Aeon 2.0 — fast answers
NVIDIA_STANZA_MODEL Stanza 2.0 — coding & math
NVIDIA_NEXOS_MODEL Nexos 3.0 — deep reasoning
NVIDIA_VISION_MODEL Vision for image/PDF attachments
NVIDIA_IMAGE_MODEL Iris 1.0 — image generation

Image and document turns transparently override the chosen text model with a vision model, so multimodal quality stays high without the user having to think about it. Voice transcription and speech are handled by NVIDIA Riva (streaming ASR + TTS).

Tech stack

Layer Technology
Frontend Vanilla HTML / CSS / JavaScript — ES modules, no framework, no build step
Backend Python · Flask · Gunicorn (gthread)
Auth Supabase Google OAuth · ES256 JWT verified via JWKS
Database Supabase Postgres with per-user row-level security
Storage Supabase Storage — private bucket, signed URLs
Inference NVIDIA AI (OpenAI-compatible chat) · NVIDIA GenAI (images) · Riva (voice)
Transport Server-Sent Events for end-to-end token streaming
Hosting Frontend on Vercel · Backend on Render · DB/Auth/Storage on Supabase

Architecture

                       Google OAuth
   Browser  ───────────────────────────────▶  Supabase Auth
      │  ◀───────────────  ES256 JWT  ──────────────┘
      │
      │   Authorization: Bearer <jwt>
      ▼
┌──────────────────────────────────────────────────────────┐
│             Flask gateway (Render, gunicorn)              │
│  • verifies the JWT against Supabase JWKS                 │
│  • enforces per-user access with the service-role key    │
│  • streams model output back over SSE                    │
└──────────────────────────────────────────────────────────┘
      │                 │                      │
      ▼                 ▼                      ▼
 Supabase          Supabase             NVIDIA endpoints
 Postgres (RLS)    Storage              • chat  (SSE, OpenAI-compatible)
                   (signed URLs)        • images (GenAI / FLUX.1)
                                        • voice  (Riva ASR + TTS)

Quick start

Prerequisites: Python 3.11+, a free Supabase project, and an NVIDIA API key.

1. Provision Supabase

  1. Create a project at supabase.com.
  2. In the SQL editor, run the migrations in backend/migrations/ in order (00010004).
  3. Under Authentication → Providers → Google, enable Google and add the redirect URI Supabase shows you (created via the Google Cloud Console).
  4. From Settings → API, copy the Project URL, the anon key (browser-safe), and the service_role key (server-only).

2. Run the backend

cd backend
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env        # fill in the Supabase + NVIDIA values
python -m app.main          # serves http://localhost:8000

GET /health should return {"status":"ok","store":"supabase","model_provider":"nvidia"}.

3. Run the frontend

The frontend is static — serve it with anything:

cd frontend
python -m http.server 5500  # then open http://localhost:5500

On first load, open Settings → Environment, paste your Supabase URL + anon key (and your backend URL if it isn't on :8000), save, and sign in with Google. For a zero-config deploy, hard-code the defaults in frontend/js/config.js.

Configuration

Backend environment variables (see render.yaml for the full list):

Variable Required Description
SUPABASE_URL Supabase project URL
SUPABASE_SERVICE_ROLE_KEY Service-role key — server-only, never in the browser
SUPABASE_STORAGE_BUCKET Private bucket for attachments (e.g. bimo-attachments)
NVIDIA_API_KEY NVIDIA inference key (chat, images, voice)
NVIDIA_AEON_MODEL Aeon 2.0 chat model id
NVIDIA_STANZA_MODEL Stanza 2.0 chat model id
NVIDIA_NEXOS_MODEL Nexos 3.0 chat model id
NVIDIA_VISION_MODEL Vision model for image/PDF attachments
NVIDIA_IMAGE_MODEL Iris text-to-image model id
CORS_ORIGINS Comma-separated allowed frontend origins
NVIDIA_MAX_TOKENS Per-reply output cap (default 8192)
RATELIMIT_ENABLED 1 to enable Flask-Limiter (off by default)

Deployment

Backend on Render — push to GitHub, then New → Blueprint and select the repo. Render reads render.yaml and provisions the bimo-backend service running under Gunicorn. Set the secret env vars (sync: false) in the dashboard and deploy.

Frontend on Vercel / Netlify / Cloudflare Pages — the frontend/ folder is fully static; drop it on any static host and point frontend/js/config.js at your Render backend and Supabase project.

Project structure

bimo/
├── backend/
│   ├── app/
│   │   ├── main.py                Flask gateway — routes, SSE streaming, model map
│   │   ├── auth.py                Supabase JWT verification (ES256 / JWKS)
│   │   ├── store.py               Postgres + Storage data layer
│   │   ├── supabase_client.py     service-role admin client
│   │   ├── nvidia_client.py       NVIDIA chat / image inference client
│   │   ├── riva_transcribe.py     voice → text (Riva streaming ASR)
│   │   ├── riva_tts.py            text → voice (Riva TTS)
│   │   ├── document_processor.py  PDF / DOCX / XLSX / PPTX extraction
│   │   ├── image_safety.py        generated-image safety checks
│   │   └── analytics.py           usage/report helpers (pandas / matplotlib)
│   ├── migrations/                0001 schema + RLS → 0004 onboarding
│   ├── tests/test_bimo.py         smoke + pinned-model-id tests
│   └── requirements.txt
├── frontend/
│   ├── index.html                 single-page shell + boot splash
│   ├── css/styles.css             design system, theming, markdown styles
│   ├── assets/                    logo, favicon, voice orb
│   └── js/
│       ├── main.js                entry + route table
│       ├── api.js                 fetch wrapper + SSE stream client
│       ├── auth.js                Supabase Auth integration
│       ├── components/            sidebar, message, model-picker, voice, onboarding…
│       └── pages/                 landing, chat, feedback, settings, not-found
├── render.yaml                    Render Blueprint (backend)
├── vercel.json                    Vercel config (frontend)
└── README.md

Security

  • No direct database access from the browser. Every read and write goes through the Flask gateway, which authenticates the request before touching data.
  • Row-level security. Postgres RLS policies (backend/migrations/0001_init.sql) scope every row to its owner, so a leaked anon key cannot read another user's conversations.
  • Server-only secrets. The Supabase service-role key and NVIDIA key never leave the backend.
  • JWKS-verified tokens. Supabase ES256 JWTs are verified against the project JWKS with a bounded, pre-warmed fetch so auth never hangs.
  • Private storage. Uploads live in a private bucket and are served through short-lived signed URLs.

Testing

cd backend
pytest -q

The suite boots the Flask app, checks /health, asserts protected routes return 401 without a JWT, and pins the real model IDs so the lineup can't silently drift.

FAQ

Is Bimo a free, open-source ChatGPT alternative? Yes. Bimo is MIT-licensed and self-hostable. You bring your own Supabase project and NVIDIA key and run the whole stack yourself.

Does it require a build step or a frontend framework? No. The frontend is plain HTML, CSS and JavaScript using native ES modules — no React, no bundler, no transpiler. Serve the folder and it works.

Which AI models does it support? Anything OpenAI-compatible. Out of the box it maps friendly names (Aeon, Stanza, Nexos, Iris) to NVIDIA-hosted open models for chat, reasoning, and image generation, plus NVIDIA Riva for voice.

Can I use my own database or model provider? The data layer is isolated in store.py and inference in nvidia_client.py, so swapping providers is a contained change rather than a rewrite.

Does it support voice, vision, and image generation? Yes — a hands-free voice assistant (Riva ASR + TTS), image and document understanding (vision + PDF/Office extraction), and inline text-to-image generation (FLUX.1).

Contributing

Issues and pull requests are welcome. For a meaningful change, open an issue first to discuss the approach. If Bimo is useful to you, a ⭐ helps others find it.

License

Released under the MIT License · © 2026 Saim Shafique.


Keywords: open-source AI chat · ChatGPT alternative · self-hosted LLM chat · Claude-style UI · streaming chat (SSE) · Supabase · Flask AI gateway · NVIDIA NIM · vanilla JavaScript · voice assistant · image generation · vision · RAG-ready document chat

Built by Saim Shafique · Live demo

About

An ultra-premium, privacy-first open-source AI chat workspace with voice assistant and image generation.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages