Skip to main content

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:

  1. VibeLLM โ€” Your persona brain (e.g., sarvam/sarvam-105b, groq/llama-3.3-70b-versatile)
  2. CoderAgent โ€” Your tool-calling brain (e.g., openai/gpt-4o, anthropic/claude-sonnet-4-20250514)
  3. 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
Google 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bhai_cli-0.1.0.tar.gz (23.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bhai_cli-0.1.0-py3-none-any.whl (26.3 kB view details)

Uploaded Python 3

File details

Details for the file bhai_cli-0.1.0.tar.gz.

File metadata

  • Download URL: bhai_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 23.7 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

Hashes for bhai_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e2f11ba17f4c68bbdb7249a8cf875ffc5d2f1118d5abbfad11f6095ddb107bc1
MD5 a5130530a6e2e3f467d89e85d4d341c6
BLAKE2b-256 d769187ba7755ca3d3a52ef9f87e83a2c932efd05d2e038c2960b50a62a8af90

See more details on using hashes here.

File details

Details for the file bhai_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bhai_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 26.3 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

Hashes for bhai_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4c86fda0fa85fc748e76c43c036c1c923d66dd3d7fb32abad272944a194089e7
MD5 c461aa2ee10828c69cdf87d8bfe738dd
BLAKE2b-256 1298af45b2a2d16ae6342f65104cee4e781dcc02bd6e8af986212c6849f79e9d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page