Skip to content

Repository files navigation

Logo

Important

I am making a direct experiment on the main branch for some reasons, so if you want to use that, just download the latest release 1.0.2 or the version 1.0.0 zip and install it with the scripts. and use it

my-free-claudecode

  • Use Claude Code with NVIDIA NIM models for free (using your NVIDIA NIM API key). This project provides a local proxy that translates Claude Code requests into NVIDIA NIM API calls.

High-Performance Multi-Server Architecture

Choose the best engine for your needs:

Engine Benefit Ideal For
Python Compatibility Best for rapid development and full feature support.
Go Concurrency High-throughput streaming with low memory footprint.
Rust Safety & Speed Maximum memory safety and consistent high performance.
C++ Latency Ultra-low latency and bare-metal execution speed.

Note

  • You must install CloudCode first, and then only should you install this proxy.
claudecode-woring-image

How It Works

Here is the detailed high-performance multi-server proxy architecture showing how requests flow, translate, and stream between Claude Code and the NVIDIA NIM APIs:

graph TD
    classDef client fill:#d1e7dd,stroke:#0f5132,stroke-width:2px;
    classDef proxy fill:#cff4fc,stroke:#087990,stroke-width:2px;
    classDef upstream fill:#f8d7da,stroke:#842029,stroke-width:2px;
    classDef storage fill:#fff3cd,stroke:#664d03,stroke-width:2px;

    subgraph ClientSpace [User Space and Client]
        User([User or Developer]) -->|runs| CC[Claude Code CLI]
    end

    subgraph ProxySpace [Local Proxy Architecture Port 2424]
        PS{Proxy Engines}:::proxy
        PyProxy[Python Proxy FastAPI Uvicorn]:::proxy
        GoProxy[Go Proxy fasthttp]:::proxy
        RustProxy[Rust Proxy axum tokio]:::proxy
        CppProxy[C++ Proxy Boost Beast]:::proxy

        PS --- PyProxy
        PS --- GoProxy
        PS --- RustProxy
        PS --- CppProxy

        AdminUI[Admin Control Panel]:::proxy

        subgraph Logic [Request Handling and Translation Core]
            LocalCheck{Is Local Fast Greeting}
            LocalGreet[Instant Local Response]

            PayloadTranslate[Payload Translation]
            ToolMap[Bidirectional Tool Use Mapping]
            ModelMap[Selected Model and Provider Resolution]
        end
    end

    subgraph ConfigSpace [Configuration and Storage]
        EnvFile[env File]:::storage
        SettingsFile[settings json File]:::storage
    end

    subgraph UpstreamSpace [Upstream Providers]
        subgraph NvidiaNim [NVIDIA NIM Provider]
            NimAPI[NVIDIA NIM API Gateway]:::upstream
            NimModels[NVIDIA NIM Models]:::upstream
        end
        subgraph OtherProviders [Other Upstream Providers Future]
            OpenAIAPI[OpenAI or OpenAI Compatible API]:::upstream
            OllamaAPI[Local Ollama or Llama.cpp API]:::upstream
        end
    end

    CC -->|1. HTTP Messages| PS
    PS -->|Read Config| EnvFile
    PS -->|Read Settings| SettingsFile

    AdminUI -->|Update Keys and Models| EnvFile
    AdminUI -->|Update Preferences| SettingsFile
    AdminUI -.->|Test Connection| NimAPI

    PyProxy & GoProxy & RustProxy & CppProxy --> LocalCheck

    LocalCheck -->|Yes| LocalGreet
    LocalGreet -->|Instant Response| CC

    LocalCheck -->|No| PayloadTranslate
    PayloadTranslate --> ToolMap
    ToolMap --> ModelMap

    ModelMap -->|2. Forward translated request| NimAPI
    ModelMap -.->|Future Extensibility| OpenAIAPI
    ModelMap -.->|Future Extensibility| OllamaAPI

    NimAPI -->|Processes request| NimModels

    NimModels -->|3. Streaming chunks| NimAPI
    NimAPI -->|Forward SSE Stream| PS

    subgraph ResponseLogic [Response Mapping Engine]
        SSEParser[SSE Parser]
        ResponseTranslate[Payload Mapping]
    end

    PS --> SSEParser
    SSEParser --> ResponseTranslate
    ResponseTranslate -->|4. Chunked Anthropic Events| CC
    CC -->|5. Real-time Typing Effect| User
Loading

Providers

Note

Currently this project only uses the NVIDIA NIM API only; other providers will be added in the future.


Installation

Linux/MacOS

Run the following command in your terminal:

curl -fsSL https://raw.githubusercontent.com/Chintanpatel24/my-free-agents/main/install.sh | bash

Windows (PowerShell)

Run the following command in PowerShell:

irm https://raw.githubusercontent.com/Chintanpatel24/my-free-agents/main/install.ps1 | iex

Python (pip)

Alternatively, you can install it as a Python package:

pip install git+https://github.com/Chintanpatel24/my-free-agents.git

Update

To update to the latest version, run the following command:

macOS / Linux

curl -fsSL https://raw.githubusercontent.com/Chintanpatel24/my-free-agents/main/update.sh | bash

Windows (PowerShell)

irm https://raw.githubusercontent.com/Chintanpatel24/my-free-agents/main/update.ps1 | iex

How to Use

Tip

  • Don't go with the higher-perimeter models like glm5.2 because they will cause a very late response for every query, so use models like Gemma 4-31B-IT for medium latency and use other fastest models that have vast token generation (a low-parameter model with good context and reasoning capabilities).
  1. Choose and Install Your Proxy Server: Run the new installation script to select your preferred high-performance engine:

    bash install_server.sh

    Engines available:

    • Python (Default): Best compatibility, uses FastAPI + Uvicorn.
    • Go: Ultra-fast, low memory usage with fasthttp.
    • Rust: Maximum performance and safety with axum + tokio.
    • C++: Lowest possible latency with Boost.Beast.
  2. Start the Proxy Server: Depending on your choice:

    # If you chose Python
    start-claudecode-server
    
    # If you chose Go
    ./bin/go-proxy
    
    # If you chose Rust
    ./bin/rust-proxy
    
    # If you chose C++
    ./bin/cpp-proxy

    The server uses a fast NVIDIA NIM default model (meta/llama-3.1-8b-instruct) so Claude Code can start immediately. You can change it any time in the Admin UI.

  3. Launch Claude Code: In a new terminal window, run:

    my-claudecode
  4. Select a Model:

    • Inside the terminal in which you host that server, open the admin panel and configure a model and check a connection.
      Admin panel

    • Select the selected model from the /model command in the claudecode (which is launched with the my-claudcode command (while server it running in background))
      /models


Configuration

If you need to change your API key later, you can:

  • Edit the .env file located at ~/.my-free-agents/claudecode/.env (Linux/Mac) or %USERPROFILE%\.my-free-agents\claudecode\.env (Windows).
  • Use the Admin UI at http://127.0.0.1:2424/admin while the server is running.
  • Set it via command line:
    start-claudecode-server --set-key your-nvapi-key

Performance options

The proxy uses HTTP/1.1 by default because it is the most reliable path for NVIDIA NIM from local Python installs. HTTP/2 is still available if your environment handles it well:

NVIDIA_NIM_HTTP2=1 start-claudecode-server

Useful optional settings:

  • NVIDIA_NIM_RETRIES=2 retries short non-streaming upstream failures.
  • NVIDIA_NIM_STREAM_RETRIES=1 retries a stream only before any response bytes are sent.
  • NVIDIA_NIM_INCLUDE_PUBLIC_CATALOG=1 adds NVIDIA's public catalog to /models; disabled by default for faster startup and model refresh.
  • FREE_AGENTS_LOCAL_GREETINGS=1 replies locally to tiny greetings like hi, so the quick health-check prompt answers instantly.

Streaming responses send the Anthropic message_start event immediately, before waiting for NVIDIA, so Claude Code should not look frozen while the upstream model is warming up.

About

Proxy server, which redirects requests to a custom API to Gaslight coding agens like Claudecode !!

Topics

Resources

Contributing

Stars

16 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages