Skip to main content

MahanAI: terminal AI agent for NVIDIA NIM (OpenAI-compatible), tools, streaming, /api-key, safety prompts.

Project description

MahanAI Super

Terminal AI agent (Super 2.0) with multi-model support, streaming chat, tools, and a built-in Claude CLI mode.

Install

pip install mahanai
mahanai

Models

MahanAI Super supports multiple backends selectable at runtime:

Pretty Name Model ID Backend
MahanAI Super mahanai/mahanai NVIDIA NIM (server)
Llama 3.3 70B meta/llama-3.3-70b-instruct NVIDIA NIM (direct)
Claude Opus 4 claude-opus-4-7 Claude CLI
Claude Sonnet 4.6 claude-sonnet-4-6 Claude CLI
Claude Haiku 4.5 claude-haiku-4-5-20251001 Claude CLI

Switch models interactively with /models (arrow-key selector) or quick-switch with /mode claude / /mode default.

Commands

Command Description
/models Interactive model selector (↑↓ arrows, Enter to confirm, Esc to cancel)
/mode claude Quick-switch to Claude Sonnet 4.6
/mode default Quick-switch back to MahanAI Super (server)
/api-key [key] Save server API key (omit key for hidden prompt)
/api-key clear Remove saved server key
/api-key-nvidia [key] Save NVIDIA direct API key
/api-key-nvidia clear Remove NVIDIA key, switch back to server
/help Show help
/exit or /quit Leave

API Keys

Server / NVIDIA NIM

  1. Environment: MAHANAI_API_KEY=...
  2. Project .env: MAHANAI_API_KEY=...
  3. In-app: /api-key your-key

Keys are stored under %APPDATA%\MahanAI\config.json on Windows or ~/.config/mahanai/config.json on Linux/macOS.

Claude CLI mode

Claude models use your local claude CLI installation. Make sure Claude Code is installed and on your PATH. No extra API key configuration needed inside MahanAI — it uses whatever account Claude CLI is authenticated with.

Environment Variables

Variable Purpose
MAHANAI_API_KEY Override saved server API key
MAHANAI_MODEL Override default model ID
MAHANAI_STREAM Set to 0/false/no/off to disable streaming
MAHANAI_CONFIG_DIR Override config file directory
NO_COLOR Disable terminal colors

Tools

MahanAI can execute tools on your behalf:

  • run_command — run shell commands (asks confirmation before destructive ops)
  • read_file — read a file
  • write_file — write a file
  • append_file — append to a file
  • list_directory — list directory contents

Develop

pip install -e .
python -m mahanai

Publish to PyPI

Bump version in both pyproject.toml and mahanai/__init__.py, then:

pip install build twine
python -m build
python -m twine check dist/*

Windows (PowerShell):

$env:TWINE_USERNAME = "__token__"
$env:TWINE_PASSWORD = "pypi-YOUR_TOKEN_HERE"
python -m twine upload dist/mahanai_super-4.0.0*

macOS / Linux:

export TWINE_USERNAME=__token__
export TWINE_PASSWORD=pypi-YOUR_TOKEN_HERE
python -m twine upload dist/mahanai_super-4.0.0*

twine cannot publish without your token; keep it out of git.

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

mahanai-4.0.0.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

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

mahanai-4.0.0-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file mahanai-4.0.0.tar.gz.

File metadata

  • Download URL: mahanai-4.0.0.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for mahanai-4.0.0.tar.gz
Algorithm Hash digest
SHA256 40e10ac9d51ac17411a195b6d17361af35eeaf2cb0f7766d4e1d903579a92a92
MD5 cfe5c7b124d7a73a2bc2928f19200b31
BLAKE2b-256 323032babe68795ecd1d54bc44da918c52c660b8ea38b04131fe7a53f06138b4

See more details on using hashes here.

File details

Details for the file mahanai-4.0.0-py3-none-any.whl.

File metadata

  • Download URL: mahanai-4.0.0-py3-none-any.whl
  • Upload date:
  • Size: 14.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for mahanai-4.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e02381c0fac69301fcef43861d6da39c5989bcbdbd4fcfc811488ea9eaa004a0
MD5 c48e8253de6f6eb6dfc9b07987f824e2
BLAKE2b-256 1d129a8ab8a1d66b0c89b556c1e8805d2c4e0c9b69098f9be6bd1825727911c3

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