Find a file
2026-01-28 21:19:16 -08:00
bot Added initial telegram support for cc-nim 2026-01-28 18:47:45 -08:00
providers new messages now get their own cli instance and replies are queued 2026-01-28 21:19:16 -08:00
tests added more heuristics to tool parser 2026-01-28 15:39:13 -08:00
wrapper Added initial telegram support for cc-nim 2026-01-28 18:47:45 -08:00
.env.example new messages now get their own cli instance and replies are queued 2026-01-28 21:19:16 -08:00
.gitignore Added initial telegram support for cc-nim 2026-01-28 18:47:45 -08:00
.python-version initial commit 2026-01-28 11:05:01 -08:00
LICENSE added license 2026-01-28 13:36:34 -08:00
nvidia_nim_models.json initial commit 2026-01-28 11:05:01 -08:00
pyproject.toml Added initial telegram support for cc-nim 2026-01-28 18:47:45 -08:00
README.md Updated readme 2026-01-28 19:10:49 -08:00
server.py new messages now get their own cli instance and replies are queued 2026-01-28 21:19:16 -08:00
uv.lock Added initial telegram support for cc-nim 2026-01-28 18:47:45 -08:00

cc-nim

Use Claude Code CLI for free with NVIDIA NIM's free unlimited 40 reqs/min API. This lightweight proxy converts Claude Code's Anthropic API requests to NVIDIA NIM format. Includes Telegram bot integration for remote control from your phone!

Quick Start

1. Get Your Free NVIDIA API Key

  1. Visit build.nvidia.com/settings/api-keys
  2. Sign in or create a free NVIDIA account
  3. Generate a new API key (nvapi-...)

2. Install & Configure

git clone https://github.com/Alishahryar1/cc-nim.git
cd cc-nim

cp .env.example .env

Edit .env:

NVIDIA_NIM_API_KEY=nvapi-your-key-here
BIG_MODEL=moonshotai/kimi-k2-instruct
SMALL_MODEL=moonshotai/kimi-k2-instruct

Claude Code

Terminal 1 - Start the proxy:

uv run uvicorn server:app --host 0.0.0.0 --port 8082

Terminal 2 - Run Claude Code:

ANTHROPIC_BASE_URL=http://localhost:8082 claude

That's it! Claude Code now uses NVIDIA NIM for free.


Telegram Bot Integration

Control Claude Code remotely via Telegram! Send tasks from your phone and watch Claude work.

Setup

  1. Get Telegram API credentials from my.telegram.org:

    • Log in with your phone number
    • Go to "API Development Tools"
    • Create an app and copy your api_id and api_hash
  2. Add to .env:

TELEGRAM_API_ID=12345678
TELEGRAM_API_HASH=your_api_hash_here
TELEGRAM_USER_ID=your_telegram_user_id

💡 To find your Telegram user ID, message @userinfobot on Telegram.

  1. Configure the workspace (where Claude will operate):
CLAUDE_WORKSPACE=./agent_workspace
ALLOWED_DIRS=C:\Users\yourname\projects
  1. Start the server:
uv run uvicorn server:app --host 0.0.0.0 --port 8082
  1. Authenticate Telegram (first run only):
    • The server will prompt for your phone number and code
    • This creates a claude_bot.session file for future runs

Usage

  • Send a message to yourself on Telegram with a task
  • Claude will respond with:
    • 💭 Thinking tokens (reasoning steps)
    • 🔧 Tool calls as they execute
    • Final result when complete
  • Send /stop to cancel a running task

Available Models

See nvidia_nim_models.json for the full list of supported models.

Popular choices:

  • moonshotai/kimi-k2.5
  • z-ai/glm4.7
  • minimaxai/minimax-m2.1
  • mistralai/devstral-2-123b-instruct-2512

Browse all models at build.nvidia.com

Updating the Model List

To update nvidia_nim_models.json with the latest models from NVIDIA NIM, run the following command:

curl "https://integrate.api.nvidia.com/v1/models" > nvidia_nim_models.json

Configuration

Variable Description Default
NVIDIA_NIM_API_KEY Your NVIDIA API key required
BIG_MODEL Model for Sonnet/Opus requests moonshotai/kimi-k2-thinking
SMALL_MODEL Model for Haiku requests moonshotai/kimi-k2-thinking
NVIDIA_NIM_BASE_URL NIM endpoint https://integrate.api.nvidia.com/v1
NVIDIA_NIM_RATE_LIMIT Requests per window 40
NVIDIA_NIM_RATE_WINDOW Rate limit window (seconds) 60

See .env.example for all supported parameters.

Development

Running Tests

To run the test suite, use the following command:

uv run pytest

Adding Your Own Provider

Extend BaseProvider in providers/ to add support for other APIs:

from providers.base import BaseProvider, ProviderConfig

class MyProvider(BaseProvider):
    async def complete(self, request):
        # Make API call, return raw JSON
        pass

    async def stream_response(self, request, input_tokens=0):
        # Yield Anthropic SSE format events
        pass

    def convert_response(self, response_json, original_request):
        # Convert to Anthropic response format
        pass