Spaces:
Running
Running
docs: complete README refactor with cloud deploy guide
Browse files- Restructured to lead with the problem/solution approach
- Added HuggingFace Spaces as primary deployment method
- Documented all deployment options (HF, Railway, Render, Fly.io, Docker)
- Added architecture overview diagram
- Simplified troubleshooting section
- Updated model list with speed ratings
- Added visual ASCII diagram for auto-routing flow
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
13 unmodified lines141516171718192021222321222523272425292627312829333435363031383233403435363738394041424344454647484950424344515246535455565758596061626348495051525354646556666758686970717273747576777879808182608384628586876566678889909192937094957273747576969778989910081828310110210310410510610710886109110888911111211311411511692931171181199612012112212310010110212412512612712812913010813113213311111211313413513613713811613914011814114212014314414514614714814915015115212215315412412512615515612815715815916016113013116213313413513613713813916316416516616716816917017114214314414514614714814915015115215317217317417515615717617717817916016116216316416516616716816917017117218018117417517617717817918018118218318418518618718218318418518618918718818919119219319019119219319619719819920020120220320420520620720820921019419519619721421519819920021721821922020120220320420520620722322420820922722822923023123223321021121223523623721321421521621721821924124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229322022122222329629729822422522630130230330430530622722830822923031023123223323423523631223723823924024131424224331631731831932032132232332432532632724424524624732924824933133233325025125225325433525525633733825725825926026126234126326434334434534634734834926526626726826927027127235235335427327435635735835936036136236327527627727827928028128236628328428528636828728828929029137037137237329229329429529637637729729838038138238338438538638738838939039139239339439539639739839940040140229930030130230330430530630740640740840941030830931031131241241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447531331431531631731847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951031932032132232351251351451532432551732632751932832952133033133233313 unmodified lines
# π€ Free Claude Code
Use Claude Code CLI, VS Code, JetBrains ACP, or chat bots through your own Anthropic-compatible proxy.**Use Claude Code with free NVIDIA NIM models through a lightweight proxy.**
[](https://opensource.org/licenses/MIT)[](https://www.python.org/downloads/)[](https://github.com/astral-sh/uv)[](https://github.com/Alishahryar1/free-claude-code/actions/workflows/tests.yml)[](https://pypi.org/project/ty/)[](https://github.com/astral-sh/uv)[](https://github.com/astral-sh/ruff)[](https://github.com/Delgan/loguru)
Free Claude Code routes Anthropic Messages API traffic from Claude Code to NVIDIA NIM. It keeps Claude Code's client-side protocol stable while letting you use NVIDIA's free models.</div>
## Git Origins## The Problem
This project is synchronized between two repositories:Claude Code costs $100+/month for API access. This project lets you run it using **free NVIDIA NIM models** instead.
| Platform | URL ||----------|-----|| **Hugging Face Spaces** | [huggingface.co/spaces/Yash030/claude-code-proxy](https://huggingface.co/spaces/Yash030/claude-code-proxy) || **GitHub** | [github.com/Yashwant00CR7/claude-code-nvidia](https://github.com/Yashwant00CR7/claude-code-nvidia) |## The Solution
[Quick Start](#quick-start) Β· [Providers](#choose-a-provider) Β· [Clients](#connect-claude-code) Β· [Troubleshooting](#troubleshooting) Β· [Development](#development)A FastAPI proxy that translates Claude Code's Anthropic API calls to NVIDIA NIM's OpenAI-compatible endpoint. Zero code changes needed in Claude Code.
</div>```βββββββββββββββββββ Anthropic API βββββββββββββββββββββ Claude Code β βββββββββββββββββββββββΆ β Free Claude ββ (Official) β β Code ββ β βββββββββββββββββββββββββ β Proxy ββββββββββββββββββββ SSE Streaming β (:8082) β ββββββββββ¬ββββββββββ β OpenAI Chat API β βΌ ββββββββββββββββββββ β NVIDIA NIM β β (Free Models) β ββββββββββββββββββββ```
<div align="center"> <img src="pic.png" alt="Free Claude Code in action" width="700"></div>## Features
## What You Get- **Drop-in replacement** for Claude Code's Anthropic API- **7 free NVIDIA NIM models** available via auto-routing- **Automatic failover** - switches to next model if one hits rate limit- **Multi-model support** - use different models for different tasks- **Local optimizations** - fast-path for common probes (saves API calls)- **Streaming** - real-time response with SSE- **Tool support** - Claude Code tools work with NIM models- **Thinking blocks** - reasoning support where models support it- **Discord/Telegram bots** - remote Claude Code sessions- **Voice notes** - transcribe voice messages with Whisper
- Drop-in proxy for Claude Code's Anthropic API calls.- NVIDIA NIM provider backend with free models.- Per-model routing: send Opus, Sonnet, Haiku, and fallback traffic to different NVIDIA NIM models.- Native Claude Code `/model` picker support through the proxy's `/v1/models` endpoint.- Streaming, tool use, reasoning/thinking block handling, and local request optimizations.- Optional Discord or Telegram bot wrapper for remote coding sessions.- Optional voice-note transcription through local Whisper or NVIDIA NIM.## Quick Start (Cloud - No Setup)
## Quick StartThe easiest way to use this project is on **HuggingFace Spaces** (free tier available).
### 1. Install Requirements### 1. Deploy to HuggingFace Spaces
<a target="_blank" href="https://huggingface.co/new-space?template=Yash030/claude-code-proxy"> <img src="https://huggingface.co/datasets/huggingface/badges/raw/main/deploy-to-spaces-lg.svg" alt="Deploy to HuggingFace Spaces"/></a>
Or manually:1. Go to [huggingface.co/spaces/Yash030/claude-code-proxy](https://huggingface.co/spaces/Yash030/claude-code-proxy)2. Duplicate the space3. Set your secrets in the Space settings: - `NVIDIA_NIM_API_KEY` - Your NVIDIA API key - `ANTHROPIC_AUTH_TOKEN` - Your auth token (any secret)
### 2. Get NVIDIA API Key
Install [Claude Code](https://github.com/anthropics/claude-code), then install `uv` and Python 3.14.Get a free key at [build.nvidia.com/settings/api-keys](https://build.nvidia.com/settings/api-keys).
macOS/Linux:### 3. Connect Claude Code
```bashcurl -LsSf https://astral.sh/uv/install.sh | shuv self updateuv python install 3.14# Use your HuggingFace Space URL (ends with .hf.space)export ANTHROPIC_AUTH_TOKEN="your-secret-token"export ANTHROPIC_BASE_URL="https://your-space-name.hf.space"claude```
Windows PowerShell:That's it! Claude Code will use free NVIDIA NIM models.
```powershellpowershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"uv self updateuv python install 3.14```## Quick Start (Local)
### 2. Clone And Configure### 1. Install Requirements
```bashgit clone https://github.com/Alishahryar1/free-claude-code.gitcd free-claude-codecp .env.example .env# Install Claude Codecurl -LsSf https://download.anthropic.com/install.sh | sh
# Install uv (fast Python package manager)curl -LsSf https://astral.sh/uv/install.sh | shuv python install 3.14```
PowerShell uses:### 2. Clone and Configure
```powershellCopy-Item .env.example .env```bashgit clone https://github.com/Yashwant00CR7/claude-code-nvidia.gitcd claude-code-nvidiacp .env.example .env```
Edit `.env` and choose one provider. For the default NVIDIA NIM path:
Edit `.env`:```dotenvNVIDIA_NIM_API_KEY="nvapi-your-key"MODEL="nvidia_nim/z-ai/glm4.7"ANTHROPIC_AUTH_TOKEN="freecc"MODEL="nvidia_nim/z-ai/glm4.7"```
Use any local secret for `ANTHROPIC_AUTH_TOKEN`; Claude Code will send the same value back to this proxy. Leave it empty only for local/private testing.
### 3. Start The Proxy### 3. Start Proxy
```bashuv syncuv run uvicorn server:app --host 0.0.0.0 --port 8082```
Package install alternative:### 4. Run Claude Code
```bashuv tool install git+https://github.com/Alishahryar1/free-claude-code.gitfcc-initfree-claude-codeexport ANTHROPIC_AUTH_TOKEN="freecc"export ANTHROPIC_BASE_URL="http://localhost:8082"claude```
`fcc-init` creates `~/.config/free-claude-code/.env` from the bundled template.## Available Models
### 4. Run Claude CodeThe proxy automatically routes to these models in order:
Point `ANTHROPIC_BASE_URL` at the proxy root. Do not append `/v1`.| Model | Best For | Speed ||-------|----------|-------|| `qwen3-coder-480b` | Code generation | Fast || `glm4.7` | General purpose | Fast || `step-3.5-flash` | Fast responses | Very Fast || `mistral-large-3` | Reasoning | Medium || `dracarys-llama-3.1-70b` | Complex tasks | Medium || `seed-oss-36b` | Balanced | Fast || `mistral-nemotron` | Thinking tasks | Medium |
PowerShell:## How Auto-Routing Works
```powershell$env:ANTHROPIC_AUTH_TOKEN="freecc"; $env:ANTHROPIC_BASE_URL="http://localhost:8082"; claude```When you use `auto` model, the proxy:
Bash:1. **Tries models in order** of speed/reliability2. **Skips rate-limited models** - pre-flight check before each request3. **Fast failover** - if one model times out, immediately tries next4. **No API waste** - common probes handled locally
```bashANTHROPIC_AUTH_TOKEN="freecc" ANTHROPIC_BASE_URL="http://localhost:8082" claude```
## Choose A Provider
Model values use this format:
```textprovider_id/model/nameRequest: "Write a function" βCheck if model 1 is rate-limited? β Yes β SkipCheck if model 2 is rate-limited? β No β Try βModel 2 responds? β Yes β Stream responseModel 2 timeout? β Try model 3 β Success!```
`MODEL` is the fallback. `MODEL_OPUS`, `MODEL_SONNET`, and `MODEL_HAIKU` override routing for requests that Claude Code sends for those tiers.
| Provider | Prefix | Transport | Key | Default base URL || --- | --- | --- | --- | --- || <img src="https://cdn.simpleicons.org/nvidia/76B900" alt="" width="18" height="18"> NVIDIA NIM | `nvidia_nim/...` | OpenAI chat translation | `NVIDIA_NIM_API_KEY` | `https://integrate.api.nvidia.com/v1` || <img src="https://cdn.simpleicons.org/groq/F55036" alt="" width="18" height="18"> Groq | `groq/...` | OpenAI chat translation | `GROQ_API_KEY` | `https://api.groq.com/openai/v1` || <img src="https://cdn.simpleicons.org/cerebras/313131" alt="" width="18" height="18"> Cerebras | `cerebras/...` | OpenAI chat translation | `CEREBRAS_API_KEY` | `https://api.cerebras.ai/v1` |
<details><summary><img src="https://cdn.simpleicons.org/nvidia/76B900" alt="" width="18" height="18"> <b>NVIDIA NIM</b></summary>
Get a key at [build.nvidia.com/settings/api-keys](https://build.nvidia.com/settings/api-keys).## Environment Variables
### Required```dotenvNVIDIA_NIM_API_KEY="nvapi-your-key"MODEL="nvidia_nim/z-ai/glm4.7"NVIDIA_NIM_API_KEY="nvapi-your-key" # From build.nvidia.comANTHROPIC_AUTH_TOKEN="your-secret" # Any secret you choose```
Popular examples:
- `nvidia_nim/qwen/qwen3-coder-480b-a35b-instruct`- `nvidia_nim/mistralai/mistral-large-3-675b-instruct-2512`- `nvidia_nim/z-ai/glm4.7`
</details>
<details><summary><img src="https://cdn.simpleicons.org/groq/F55036" alt="" width="18" height="18"> <b>Groq</b></summary>
Get a key at [console.groq.com/keys](https://console.groq.com/keys).
### Optional```dotenvGROQ_API_KEY="gsk_..."MODEL="groq/openai/gpt-oss-120b"```
Popular examples:
- `groq/openai/gpt-oss-120b` (Best overall for Claude Code)- `groq/openai/gpt-oss-20b` (Ultra-low latency)- `groq/llama-3.3-70b-versatile`
</details>
<details><summary><img src="https://cdn.simpleicons.org/cerebras/313131" alt="" width="18" height="18"> <b>Cerebras</b></summary>MODEL="nvidia_nim/z-ai/glm4.7" # Default modelMODEL_OPUS="nvidia_nim/qwen/qwen3-..." # Model for Opus requestsMODEL_SONNET="nvidia_nim/z-ai/glm4.7" # Model for Sonnet requestsMODEL_HAIKU="nvidia_nim/z-ai/glm4.7" # Model for Haiku requests
Get a key at [cloud.cerebras.ai](https://cloud.cerebras.ai/).# Auto-routing order (comma-separated)AUTO_MODEL_PRIORITY="nvidia_nim/qwen/...,nvidia_nim/z-ai/..."
```dotenvCEREBRAS_API_KEY="csk_..."MODEL="cerebras/gpt-oss-120b"# Thinking supportENABLE_MODEL_THINKING=true # Enable reasoning blocks```
Popular examples:
- `cerebras/gpt-oss-120b` (~3000 tok/s - Fastest reasoning)- `cerebras/qwen-3-235b`- `cerebras/llama3.1-8b`
</details>
## Connect Claude Code
### Claude Code CLI
```bashANTHROPIC_AUTH_TOKEN="freecc" ANTHROPIC_BASE_URL="http://localhost:8082" claude```## IDE Integration
### VS Code Extension
Open Settings, search for `claude-code.environmentVariables`, choose **Edit in settings.json**, and add:
Add to `.vscode/settings.json`:```json{"claudeCode.environmentVariables": [ { "name": "ANTHROPIC_BASE_URL", "value": "http://localhost:8082" }, { "name": "ANTHROPIC_AUTH_TOKEN", "value": "freecc" }] "claudeCode.environmentVariables": [ { "name": "ANTHROPIC_BASE_URL", "value": "http://localhost:8082" }, { "name": "ANTHROPIC_AUTH_TOKEN", "value": "freecc" } ]}```
Reload the extension. If the extension shows a login screen, choose the Anthropic Console path once; the local proxy still handles model traffic after the environment variables are active.
### JetBrains ACP
Edit the installed Claude ACP config:
- Windows: `C:\Users\%USERNAME%\AppData\Roaming\JetBrains\acp-agents\installed.json`- Linux/macOS: `~/.jetbrains/acp.json`
Set the environment for `acp.registry.claude-acp`:
Edit `~/.jetbrains/acp.json`:```json{"env": { "ANTHROPIC_BASE_URL": "http://localhost:8082", "ANTHROPIC_AUTH_TOKEN": "freecc" "env": { "ANTHROPIC_BASE_URL": "http://localhost:8082", "ANTHROPIC_AUTH_TOKEN": "freecc" }}```
Restart the IDE after changing the file.
### Model Picker
Claude Code 2.1.126 or later reads this proxy's `/v1/models` endpoint when `ANTHROPIC_BASE_URL` points at the proxy. Start Claude Code normally, run `/model`, and choose any discovered provider model.
<div align="center"> <img src="cc-model-picker.png" alt="Claude Code model picker showing gateway models" width="700"></div>
The proxy lists models for configured provider keys and referenced local providers. Picker-safe IDs are routed back to the real provider/model automatically, so no `.env` edit or separate launcher script is needed after startup.
Each provider model also has a `(no thinking)` picker variant. Use it when a model does not support Claude Code thinking or fails with adaptive-thinking requests. It routes to the same upstream model while asking Claude Code to send a non-thinking request.
## Optional Integrations
### Discord And Telegram Bots
The bot wrapper runs Claude Code sessions remotely, streams progress, supports reply-based conversation branches, and can stop or clear tasks.
Discord minimum config:
```dotenvMESSAGING_PLATFORM="discord"DISCORD_BOT_TOKEN="your-discord-bot-token"ALLOWED_DISCORD_CHANNELS="123456789"CLAUDE_WORKSPACE="./agent_workspace"ALLOWED_DIR="C:/Users/yourname/projects"```
Create the bot in the [Discord Developer Portal](https://discord.com/developers/applications), enable Message Content Intent, and invite it with read/send/history permissions.
Telegram minimum config:
```dotenvMESSAGING_PLATFORM="telegram"TELEGRAM_BOT_TOKEN="123456789:ABC..."ALLOWED_TELEGRAM_USER_ID="your-user-id"CLAUDE_WORKSPACE="./agent_workspace"ALLOWED_DIR="C:/Users/yourname/projects"```
Get a token from [@BotFather](https://t.me/BotFather) and your user ID from [@userinfobot](https://t.me/userinfobot).
Useful commands:
- `/stop` cancels a task; reply to a task message to stop only that branch.- `/clear` resets sessions; reply to clear one branch.- `/stats` shows session state.
### Voice Notes
Voice notes work on Discord and Telegram. Choose one backend:### Remote/Ssh
For remote development, deploy to HuggingFace Spaces and use:```bashuv sync --extra voice_localuv sync --extra voiceuv sync --extra voice --extra voice_localexport ANTHROPIC_BASE_URL="https://your-space.hf.space"```
```dotenvVOICE_NOTE_ENABLED=trueWHISPER_DEVICE="cpu" # cpu | cuda | nvidia_nimWHISPER_MODEL="base"HF_TOKEN=""```## Deployment Options
Use `WHISPER_DEVICE="nvidia_nim"` with the `voice` extra and `NVIDIA_NIM_API_KEY` for NVIDIA-hosted transcription.### HuggingFace Spaces (Recommended for Cloud)
## Configuration Reference**Free tier includes:**- 2 vCPU- Community support- Automatic HTTPS- Git-based deployment
[`.env.example`](.env.example) is the canonical list of variables. The sections below are the ones most users change.**Setup:**1. Fork [the space](https://huggingface.co/spaces/Yash030/claude-code-proxy)2. Add `NVIDIA_NIM_API_KEY` to Space secrets3. Access at `https://your-space.hf.space`
### Model Routing### Railway (Easy Deploy)
```dotenvMODEL="nvidia_nim/z-ai/glm4.7"MODEL_OPUS=MODEL_SONNET=MODEL_HAIKU=ENABLE_MODEL_THINKING=trueENABLE_OPUS_THINKING=ENABLE_SONNET_THINKING=ENABLE_HAIKU_THINKING=```
Blank per-tier values inherit the fallback. Blank thinking overrides inherit `ENABLE_MODEL_THINKING`.1. Connect GitHub repo2. Set environment variables3. Deploy with auto-scaling
### Provider Keys And URLs### Render (Free Tier)
```dotenvNVIDIA_NIM_API_KEY=""```1. Create Web Service2. Connect GitHub3. Set build command: `uv sync`4. Set start command: `uv run uvicorn server:app --host 0.0.0.0 --port $PORT`
Proxy settings are per provider:### Fly.io (Global Edge)
```dotenvNVIDIA_NIM_PROXY=""```bashfly launchfly secrets set NVIDIA_NIM_API_KEY="nvapi-..."fly deploy```
### Rate Limits And Timeouts### Local/Docker
```dotenvPROVIDER_RATE_LIMIT=1PROVIDER_RATE_WINDOW=3PROVIDER_MAX_CONCURRENCY=5HTTP_READ_TIMEOUT=120HTTP_WRITE_TIMEOUT=10HTTP_CONNECT_TIMEOUT=10```bashdocker build -t free-claude-code .docker run -p 8082:8082 \ -e NVIDIA_NIM_API_KEY="nvapi-..." \ -e ANTHROPIC_AUTH_TOKEN="freecc" \ free-claude-code```
Use lower limits for free hosted providers; local providers can usually tolerate higher concurrency if the machine can handle it.
### Security And Diagnostics## Architecture
```dotenvANTHROPIC_AUTH_TOKEN=LOG_RAW_API_PAYLOADS=falseLOG_RAW_SSE_EVENTS=falseLOG_API_ERROR_TRACEBACKS=falseLOG_RAW_MESSAGING_CONTENT=falseLOG_RAW_CLI_DIAGNOSTICS=falseLOG_MESSAGING_ERROR_DETAILS=false```api/βββ routes.py # FastAPI endpointsβββ services.py # Request handling & failoverβββ model_router.py # Model resolutionβββ detection.py # Request type detectionβββ optimization_handlers.py # Fast-path responses
Raw logging flags can expose prompts, tool arguments, paths, and model output. Keep them off unless you are debugging locally.core/βββ anthropic/ # SSE, token counting, tool parsingβββ task_detector.py # Task capability detection
### Local Web Toolsproviders/βββ openai_compat.py # Base OpenAI transportβββ nvidia_nim/ # NVIDIA NIM providerβββ rate_limit.py # Rate limiting
```dotenvENABLE_WEB_SERVER_TOOLS=trueWEB_FETCH_ALLOWED_SCHEMES=http,httpsWEB_FETCH_ALLOW_PRIVATE_NETWORKS=falsemessaging/βββ discord.py # Discord bot wrapperβββ telegram.py # Telegram bot wrapper```
These tools perform outbound HTTP from the proxy. Keep private-network access disabled unless you are in a controlled lab environment.
## Troubleshooting
### **Major Fixes (May 2026)**
#### **1. Model Visibility & Caching Issues**The Claude CLI often caches model lists, causing local proxy models to disappear.- **Fix:** We implemented a "Multi-Model Advertisement" feature. The `MODEL` environment variable now supports a comma-separated list.- **Action:** Set `MODEL="model1,model2,model3"` in your `.env`. The proxy will force the CLI to display all of them by registering them as primary models.
#### **2. The "Amnesia/Thinking" Loop**When using `auto` mode, the proxy would sometimes switch models in the middle of a "Thinking" block if it took too long, causing the CLI to repeat the same thought endlessly.- **Fix:** Implemented "Sticky Sessions" in `api/services.py`. Once a model yields its first event (including thinking blocks), the proxy commits to that model for the duration of the turn. Fallbacks only occur if the model fails to start entirely.
#### **3. NVIDIA NIM Fallback Sync**Ensured that the `AUTO_MODEL_PRIORITY` and `NVIDIA_NIM_FALLBACK_MODELS` are synchronized to provide maximum coverage.
### Claude Code says `undefined ... input_tokens`, `$.speed`, or malformed response
Update to the latest commit first. Older versions could emit invalid usage metadata in streaming responses. Then check:
- `ANTHROPIC_BASE_URL` is `http://localhost:8082`, not `http://localhost:8082/v1`.- The proxy is returning Server-Sent Events for `/v1/messages`.- `server.log` contains no upstream 400/500 response before the malformed-response error.
### "undefined ... input_tokens" error- Update to latest version: `git pull`- Check `ANTHROPIC_BASE_URL` doesn't end with `/v1`
### Provider disconnects during streaming- Reduce `PROVIDER_MAX_CONCURRENCY`- Increase `HTTP_READ_TIMEOUT`- Check NVIDIA NIM status at [status.nvidia.com](https://status.nvidia.com)
Errors like `incomplete chunked read`, `server disconnected`, or a peer closing the body usually come from the upstream provider or gateway. Reduce concurrency, raise timeouts, or retry later.
### Tool calls work on one model but not another
Tool support is model and provider dependent. Some OpenAI-compatible models emit malformed tool-call deltas, omit tool names, or return tool calls as plain text. Try another model or provider before assuming the proxy is broken.### Model not responding- Check your NVIDIA API key is valid- Verify rate limits haven't been hit- Try a different model
### The VS Code extension still shows a login screen
Confirm the extension environment variables are set, then reload the extension or restart VS Code. The browser login flow may still appear once; the local proxy is used when `ANTHROPIC_BASE_URL` is active in the extension process.
## How It Works
```textClaude Code CLI / IDE | | Anthropic Messages API vFree Claude Code proxy (:8082) | | provider-specific request/stream adapter vNVIDIA NIM```
Important pieces:
- FastAPI exposes Anthropic-compatible routes such as `/v1/messages`, `/v1/messages/count_tokens`, and `/v1/models`.- Model routing resolves the Claude model name to `MODEL_OPUS`, `MODEL_SONNET`, `MODEL_HAIKU`, or `MODEL`.- NVIDIA NIM uses OpenAI chat streaming translated into Anthropic SSE.- The proxy normalizes thinking blocks, tool calls, token usage metadata, and provider errors into the shape Claude Code expects.- Request optimizations answer trivial Claude Code probes locally to save latency and quota.
## Development
### Project Structure
```textfree-claude-code/βββ server.py # ASGI entry pointβββ api/ # FastAPI routes, service layer, routing, optimizationsβββ core/ # Shared Anthropic protocol helpers and SSE utilitiesβββ providers/ # Provider transports, registry, rate limitingβββ messaging/ # Discord/Telegram adapters, sessions, voiceβββ cli/ # Package entry points and Claude process managementβββ config/ # Settings, provider catalog, loggingβββ tests/ # Unit and contract tests```
### Commands
```bashuv run ruff formatuv run ruff checkuv run ty checkuv run pytest```
Run them in that order before pushing. CI enforces the same checks.
### Package Scripts
`pyproject.toml` installs:
- `free-claude-code`: starts the proxy with configured host and port.- `fcc-init`: creates the user config template at `~/.config/free-claude-code/.env`.
### Extending
- Add messaging platforms by implementing the `MessagingPlatform` interface in `messaging/`.- Extend NVIDIA NIM provider functionality by modifying `providers/nvidia_nim/`.### VS Code extension shows login- Reload the extension after setting env vars- Confirm environment variables are set correctly
## Contributing
- Report bugs and feature requests in [Issues](https://github.com/Alishahryar1/free-claude-code/issues).- Keep changes small and covered by focused tests.- Do not open Docker integration PRs.- Do not open README change PRs just open an issue for it.- Run the full check sequence before opening a pull request.- The syntax Except X, Y is brought back in python 3.14 final version (not in 3.14 alpha). Keep in mind before opening PRs.
## NVIDIA Qwen integration
You can run a simple NVIDIA Qwen streaming example using the OpenAI-compatible client shipped below.
- Install the dependency:
```bashpip install -r requirements.txt```
- Set your NVIDIA API key (do NOT commit keys). Example (PowerShell temporary):
```powershell$env:NV_API_KEY = "nvapi-<YOUR_KEY>"python nvidia_integration.py "Write a short Python script that prints Hello"```
Persisted (Windows):
```powershellsetx NV_API_KEY "nvapi-<YOUR_KEY>"# open a new shell to use the persisted variable```
Linux/macOS:1. Fork the repo2. Create a feature branch3. Run checks: `uv run ruff format && uv run ruff check && uv run ty check`4. Submit PR
```bashexport NV_API_KEY="nvapi-<YOUR_KEY>"python nvidia_integration.py "Write a short Python script that prints Hello"```## License
The example `nvidia_integration.py` streams completions from `https://integrate.api.nvidia.com/v1` using the `qwen/qwen3-coder-480b-a35b-instruct` model. Replace `<YOUR_KEY>` with your actual NVIDIA API key. Never share or commit your API keys.MIT License - See [LICENSE](LICENSE)
## License## Links
MIT License. See [LICENSE](LICENSE) for details.- [GitHub](https://github.com/Yashwant00CR7/claude-code-nvidia)- [HuggingFace Space](https://huggingface.co/spaces/Yash030/claude-code-proxy)- [NVIDIA NIM](https://build.nvidia.com)- [Claude Code](https://github.com/anthropics/claude-code)README.md+205-393