BHAI โ The Dual-Brain AI Coding Agent with Punjabi Swagger. Indic-native voice + universal LLM tool-calling.
Project description
๐ฎ๐ณ BHAI-CLI
The Dual-Brain AI Coding Agent โ 22 Indian Languages. One CLI.
เคญเคพเค ยท เฆญเฆพเฆ ยท เชญเชพเช ยท เจญเจพเจ ยท เฐญเฐพเฐฏเฑ ยท เฒญเฒพเฒฏเณ ยท เคญเคพเค ยท เฆญเฆพเฆ
BHAI is a lean, zero-state resilient CLI tool that acts as your 10x Senior SDE from India. It uses a Dual-Brain Architecture โ a VibeLLM for persona and intent parsing, and a CoderAgent for tool-calling execution โ all powered by litellm for universal LLM provider support and Sarvam AI for 22 Indian language understanding.
"You are BHAI, a 10x Senior SDE from India. Sab bhasha samajhte ho. You roast O(Nยฒ) loops and unoptimized Dockerfiles."
โจ Features
- ๐ง Dual-Brain Architecture: VibeLLM (persona + intent) โ CoderAgent (tool execution) โ VibeLLM (swagger summary)
- ๐ฎ๐ณ 22 Indian Languages: Speak in Hindi, Punjabi, Bengali, Tamil, Telugu, Gujarati, Marathi, Kannada, Malayalam, and more โ powered by Sarvam AI
- ๐ Universal LLM Support: Every provider on Earth โ OpenAI, Anthropic, Groq, Google Gemini, Sarvam, Mistral, Cerebras, Ollama, Bedrock, and more via litellm
- ๐๏ธ Indic Voice Interface: Sarvam Saaras v3 (STT) translates any Indian language to English, Bulbul v3 (TTS) reads responses back
- ๐ง MCP-Style Tools:
execute_bash,web_search,codebase_contextโ with a hard[Y/n]guardrail on every command - โก Zero-State Resilience: Boots in <300ms, persistent YAML config, hot-swappable model overrides
- ๐ฆ PyPI-Ready: Clean
src/layout, Poetry-managed, lean dependency footprint
๐ Installation
pip install bhai-cli
With voice support (optional):
pip install "bhai-cli[audio]"
# Also needs: sudo apt install libportaudio2 (Linux)
โ๏ธ Setup
bhai-code setup
The interactive wizard will configure:
- VibeLLM โ Your persona brain (e.g.,
sarvam/sarvam-105b,groq/llama-3.3-70b-versatile) - CoderAgent โ Your tool-calling brain (e.g.,
openai/gpt-4o,anthropic/claude-sonnet-4-20250514) - Sarvam AI โ Voice interface API key (optional)
Model Format
Uses litellm's model naming:
| Provider | Format | Example |
|---|---|---|
| OpenAI | openai/model |
openai/gpt-4o |
| Anthropic | anthropic/model |
anthropic/claude-sonnet-4-20250514 |
gemini/model |
gemini/gemini-2.5-flash |
|
| Groq | groq/model |
groq/llama-3.3-70b-versatile |
| Sarvam | sarvam/model |
sarvam/sarvam-105b |
| Mistral | mistral/model |
mistral/mistral-large-latest |
| Cerebras | cerebras/model |
cerebras/llama-3.3-70b |
| Ollama | ollama/model |
ollama/llama3 |
๐ฌ Usage
Text Mode
# Single prompt
bhai-code text "find all TODO comments in this project"
# Interactive chat
bhai-code text "what does this codebase do?" --interactive
# Override models on the fly
bhai-code text "optimize this Dockerfile" --vibe-model groq/llama-3.3-70b-versatile --coder-model openai/gpt-4o
Voice Mode
# Live microphone
bhai-code listen
# From audio file
bhai-code listen --file recording.wav
View Config
bhai-code config
๐๏ธ Architecture
User Input (Any of 22 Indian Languages / English)
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโ
โ VibeLLM (Brain A) โ โ Persona + Intent Parsing
โ Sarvam-105B / any โ
โโโโโโโโโโโโฌโโโโโโโโโโโ
โ {"task": "clean English intent"}
โผ
โโโโโโโโโโโโโโโโโโโโโโโ
โ CoderAgent (Brain B)โ โ Tool-Calling Execution
โ Any litellm model โ
โ โ
โ Tools: โ
โ โข execute_bash โ โ [Y/n] guardrail
โ โข web_search โ โ DuckDuckGo
โ โข codebase_context โ โ AST signatures
โโโโโโโโโโโโฌโโโโโโโโโโโ
โ Results
โผ
โโโโโโโโโโโโโโโโโโโโโโโ
โ VibeLLM (Brain A) โ โ Swagger Summary
โโโโโโโโโโโโโโโโโโโโโโโ
๐ง Tools
| Tool | Description |
|---|---|
execute_bash |
Run shell commands with mandatory [Y/n] confirmation, timeout handling |
web_search |
DuckDuckGo search for real-time debugging and docs lookup |
codebase_context |
Smart directory scanner with AST-based signature extraction (anti-context-rot) |
๐ Project Structure
bhai-cli/
โโโ src/bhai_cli/
โ โโโ __init__.py # Package metadata
โ โโโ cli.py # Typer CLI (setup, text, listen, config)
โ โโโ config_manager.py # Pydantic YAML/env config engine
โ โโโ orchestrator.py # Dual-Brain routing logic
โ โโโ audio_engine.py # Sarvam STT/TTS + mic recording
โ โโโ tools/
โ โโโ __init__.py # Tool registry + JSON schemas
โ โโโ bash.py # execute_bash with guardrails
โ โโโ search.py # web_search via DuckDuckGo
โ โโโ codebase.py # codebase_context with AST
โโโ tests/
โโโ pyproject.toml # Poetry config (lean deps)
โโโ README.md
โโโ LICENSE # Apache-2.0
๐ Environment Variables
| Variable | Description |
|---|---|
SARVAM_API_KEY |
Sarvam AI API key |
VIBE_API_KEY |
VibeLLM provider API key |
CODER_API_KEY |
CoderAgent provider API key |
GROQ_API_KEY |
Groq API key (auto-detected by litellm) |
OPENAI_API_KEY |
OpenAI API key (auto-detected by litellm) |
ANTHROPIC_API_KEY |
Anthropic API key (auto-detected by litellm) |
GEMINI_API_KEY |
Google Gemini API key (auto-detected by litellm) |
You can also use a .env file in your working directory.
๐บ๏ธ Roadmap (v2)
- MCP Server connectivity for external tool integration
- Streaming responses
- Multi-turn CoderAgent memory
- Plugin system for custom tools
๐ License
Apache-2.0 โ see LICENSE.
Built with โค๏ธ from India by Madhav Kapila.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bhai_cli-0.2.1.tar.gz.
File metadata
- Download URL: bhai_cli-0.2.1.tar.gz
- Upload date:
- Size: 28.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.2 CPython/3.14.4 Linux/7.0.0-15-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4054c6d1465ca8c9ac524a16de65475297d3b648839dde6fc06a9d510957afda
|
|
| MD5 |
a21aa2d3fb415ebc7a66437838548643
|
|
| BLAKE2b-256 |
5d4c9e34dc3128ace604b85c2e4cbf972cb46f3f4b885559508e4d0ac179bb63
|
File details
Details for the file bhai_cli-0.2.1-py3-none-any.whl.
File metadata
- Download URL: bhai_cli-0.2.1-py3-none-any.whl
- Upload date:
- Size: 31.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.2 CPython/3.14.4 Linux/7.0.0-15-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce0aced07aa43ad44a61d2f519381eb22f4e2cef00e9d802fe4663d82adea13d
|
|
| MD5 |
3a7603db5abe15751700c96320bde3aa
|
|
| BLAKE2b-256 |
7034186f9bcef373169c8d0359e667166c67d36041f1710d9c3fa35eec4686de
|