Who it is forA developer working offline or with code that cannot leave the machine, who already runs a local model server.
The problemCoding agents are usually wired to hosted APIs, which sends source code to outside providers.
The outcomeThe gateway forwards agent requests to a local model server at a local base URL, and the agent works without a hosted provider key.
What you need first
- Python 3.11 or newer
- A clone of the my-free-code repository
- At least one provider API key for the MODEL values you choose, or a local model server such as Ollama, LM Studio, or llama.cpp
- Claude Code or another supported client installed and on PATH
Steps
- Start your local model server, such as Ollama at http://127.0.0.1:11434/v1, LM Studio at http://127.0.0.1:1234/v1, or llama.cpp at http://127.0.0.1:8080/v1.
- Run
cp .env.example .envand set OLLAMA_BASE_URL, LM_STUDIO_BASE_URL, or LLAMACPP_BASE_URL plus MODEL to the matching local model, such as ollama/llama3.1. - Run
python -m my_free_codeto start the gateway. - Run
python -m my_free_code.cli.mfc claudeor another launcher command from the README to connect your agent. - Confirm the gateway log shows the request reaching your local server rather than a hosted provider.
Prompt for your agent
In the my-free-code repository, set OLLAMA_BASE_URL and MODEL=ollama/<model-name> in .env, start the gateway with python -m my_free_code, and send one test request. Expected output: a completed response generated by the local model. Verify that no hosted provider key is required for the request to succeed.
Caveat. The README says the gateway is intended for local use, so keep HOST set to 127.0.0.1 and do not expose the Admin endpoints to the Internet.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for hkqr/my-free-code and "Run coding agents against local models"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer