Skip to content

Use Claude Code, Codex, VSCode, Pi, and OpenCode (and 6 other harnesses) for free (1.3B+ free tokens) from your terminal, app, IDE, or phone, and now from the browser with native browser sessions (multi-harness + multi-model) like OpenClaw (voice supported + ToS friendly)

Python

Updated README

Alishahryar1598e21387ee6
diff --git a/README.md b/README.md
index 368f53f5..088eb306 100644
--- a/README.md
+++ b/README.md
@@ -32,6 +32,7 @@ A lightweight proxy that routes Claude Code's Anthropic API calls to **NVIDIA NI
| **Zero Cost** | 40 req/min free on NVIDIA NIM. Free models on OpenRouter. Fully local with LM Studio |
| **Drop-in Replacement** | Set 2 env vars. No modifications to Claude Code CLI or VSCode extension needed |
| **3 Providers** | NVIDIA NIM, OpenRouter (hundreds of models), LM Studio (local & offline) |
+| **Per-Tier Model Mapping** | Route Opus / Sonnet / Haiku requests to different models and providers. Mix providers freely per tier |
| **Thinking Token Support** | Parses `<think>` tags and `reasoning_content` into native Claude thinking blocks |
| **Heuristic Tool Parser** | Models outputting tool calls as text are auto-parsed into structured tool use |
| **Request Optimization** | 5 categories of trivial API calls intercepted locally, saving quota and latency |
@@ -67,7 +68,7 @@ Choose your provider and edit `.env`:
```dotenv
NVIDIA_NIM_API_KEY="nvapi-your-key-here"
-MODEL="nvidia_nim/stepfun-ai/step-3.5-flash"
+MODEL="nvidia_nim/z-ai/glm4.7"
```
</details>
@@ -91,6 +92,23 @@ MODEL="lmstudio/lmstudio-community/qwen2.5-7b-instruct"
</details>
+<details>
+<summary><b>Per-Tier Model Mapping</b> (mix providers per Claude tier)</summary>
+
+Claude Code sends requests tagged as Opus, Sonnet, or Haiku. You can route each tier to a different model — even across different providers. `MODEL` acts as the fallback when a tier-specific variable is not set.
+
+```dotenv
+NVIDIA_NIM_API_KEY="nvapi-your-key-here"
+OPENROUTER_API_KEY="sk-or-your-key-here"
+
+MODEL_OPUS="nvidia_nim/z-ai/glm4.7"
+MODEL_SONNET="open_router/arcee-ai/trinity-large-preview:free"
+MODEL_HAIKU="open_router/stepfun/step-3.5-flash:free"
+MODEL="nvidia_nim/z-ai/glm4.7" # fallback for unrecognized tiers
+```
+
+</details>
+
### Run It
**Terminal 1:** Start the proxy server:
@@ -180,6 +198,7 @@ alias claude-kimi='ANTHROPIC_BASE_URL="http://localhost:8082" ANTHROPIC_AUTH_TOK
```
- **Transparent proxy**: Claude Code sends standard Anthropic API requests to the proxy server
+- **Per-tier model routing**: Opus / Sonnet / Haiku requests are resolved to their tier-specific model and provider, with the default `MODEL` as fallback
- **Request optimization**: 5 categories of trivial requests (quota probes, title generation, prefix detection, suggestions, filepath extraction) are intercepted and responded to instantly without using API quota
- **Format translation**: real requests are translated from Anthropic format to the provider's OpenAI-compatible format and streamed back
- **Thinking tokens**: `<think>` tags and `reasoning_content` fields are converted into native Claude thinking blocks so Claude Code renders them correctly
@@ -368,35 +387,38 @@ Browse: [model.lmstudio.ai](https://model.lmstudio.ai)
## Configuration
-| Variable | Description | Default |
-| --------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------- |
-| `MODEL` | Model to use (prefix format: `provider/model/name`; invalid prefix causes error) | `nvidia_nim/stepfun-ai/step-3.5-flash` |
-| `NVIDIA_NIM_API_KEY` | NVIDIA API key (NIM provider) | required |
-| `OPENROUTER_API_KEY` | OpenRouter API key (OpenRouter provider) | required |
-| `LM_STUDIO_BASE_URL` | LM Studio server URL | `http://localhost:1234/v1` |
-| `PROVIDER_RATE_LIMIT` | LLM API requests per window | `40` |
-| `PROVIDER_RATE_WINDOW` | Rate limit window (seconds) | `60` |
-| `PROVIDER_MAX_CONCURRENCY` | Max simultaneous open provider streams | `5` |
-| `HTTP_READ_TIMEOUT` | Read timeout for provider API requests (seconds) | `300` |
-| `HTTP_WRITE_TIMEOUT` | Write timeout for provider API requests (seconds) | `10` |
-| `HTTP_CONNECT_TIMEOUT` | Connect timeout for provider API requests (seconds) | `2` |
-| `FAST_PREFIX_DETECTION` | Enable fast prefix detection | `true` |
-| `ENABLE_NETWORK_PROBE_MOCK` | Enable network probe mock | `true` |
-| `ENABLE_TITLE_GENERATION_SKIP` | Skip title generation | `true` |
-| `ENABLE_SUGGESTION_MODE_SKIP` | Skip suggestion mode | `true` |
-| `ENABLE_FILEPATH_EXTRACTION_MOCK` | Enable filepath extraction mock | `true` |
-| `MESSAGING_PLATFORM` | Messaging platform: `discord` or `telegram` | `discord` |
-| `DISCORD_BOT_TOKEN` | Discord Bot Token | `""` |
-| `ALLOWED_DISCORD_CHANNELS` | Comma-separated channel IDs (empty = none allowed) | `""` |
-| `TELEGRAM_BOT_TOKEN` | Telegram Bot Token | `""` |
-| `ALLOWED_TELEGRAM_USER_ID` | Allowed Telegram User ID | `""` |
-| `VOICE_NOTE_ENABLED` | Enable voice note handling | `true` |
-| `WHISPER_MODEL` | Local Whisper model size | `base` |
-| `WHISPER_DEVICE` | `cpu` \| `cuda` | `cpu` |
-| `MESSAGING_RATE_LIMIT` | Messaging messages per window | `1` |
-| `MESSAGING_RATE_WINDOW` | Messaging window (seconds) | `1` |
-| `CLAUDE_WORKSPACE` | Directory for agent workspace | `./agent_workspace` |
-| `ALLOWED_DIR` | Allowed directories for agent | `""` |
+| Variable | Description | Default |
+| --------------------------------- | ---------------------------------------------------------------------------------- | -------------------------------------- |
+| `MODEL` | Fallback model (prefix format: `provider/model/name`; invalid prefix causes error) | `nvidia_nim/stepfun-ai/step-3.5-flash` |
+| `MODEL_OPUS` | Model for Claude Opus tier requests (optional, falls back to `MODEL`) | — |
+| `MODEL_SONNET` | Model for Claude Sonnet tier requests (optional, falls back to `MODEL`) | — |
+| `MODEL_HAIKU` | Model for Claude Haiku tier requests (optional, falls back to `MODEL`) | — |
+| `NVIDIA_NIM_API_KEY` | NVIDIA API key (NIM provider) | required |
+| `OPENROUTER_API_KEY` | OpenRouter API key (OpenRouter provider) | required |
+| `LM_STUDIO_BASE_URL` | LM Studio server URL | `http://localhost:1234/v1` |
+| `PROVIDER_RATE_LIMIT` | LLM API requests per window | `40` |
+| `PROVIDER_RATE_WINDOW` | Rate limit window (seconds) | `60` |
+| `PROVIDER_MAX_CONCURRENCY` | Max simultaneous open provider streams | `5` |
+| `HTTP_READ_TIMEOUT` | Read timeout for provider API requests (seconds) | `120` |
+| `HTTP_WRITE_TIMEOUT` | Write timeout for provider API requests (seconds) | `10` |
+| `HTTP_CONNECT_TIMEOUT` | Connect timeout for provider API requests (seconds) | `2` |
+| `FAST_PREFIX_DETECTION` | Enable fast prefix detection | `true` |
+| `ENABLE_NETWORK_PROBE_MOCK` | Enable network probe mock | `true` |
+| `ENABLE_TITLE_GENERATION_SKIP` | Skip title generation | `true` |
+| `ENABLE_SUGGESTION_MODE_SKIP` | Skip suggestion mode | `true` |
+| `ENABLE_FILEPATH_EXTRACTION_MOCK` | Enable filepath extraction mock | `true` |
+| `MESSAGING_PLATFORM` | Messaging platform: `discord` or `telegram` | `discord` |
+| `DISCORD_BOT_TOKEN` | Discord Bot Token | `""` |
+| `ALLOWED_DISCORD_CHANNELS` | Comma-separated channel IDs (empty = none allowed) | `""` |
+| `TELEGRAM_BOT_TOKEN` | Telegram Bot Token | `""` |
+| `ALLOWED_TELEGRAM_USER_ID` | Allowed Telegram User ID | `""` |
+| `VOICE_NOTE_ENABLED` | Enable voice note handling | `true` |
+| `WHISPER_MODEL` | Local Whisper model size | `base` |
+| `WHISPER_DEVICE` | `cpu` \| `cuda` | `cpu` |
+| `MESSAGING_RATE_LIMIT` | Messaging messages per window | `1` |
+| `MESSAGING_RATE_WINDOW` | Messaging window (seconds) | `1` |
+| `CLAUDE_WORKSPACE` | Directory for agent workspace | `./agent_workspace` |
+| `ALLOWED_DIR` | Allowed directories for agent | `""` |
See [`.env.example`](.env.example) for all supported parameters.