What do you want to do?
4 use cases
-
Run Claude Code on other model providers
Route Claude Code requests through a local gateway to the provider models you configure.
- My Free Code
- Claude Code
- Software and DevOps
- Intermediate
View prompt
Work in the my-free-code repository. Set MODEL_SONNET in .env to <provider/model-id>, start the gateway with python -m my_free_code, then launch Claude Code with python -m my_free_code.cli.mfc claude. Expected output: Claude Code opens and answers a short test prompt. Verify that the gateway log shows a request routed to <provider/model-id>.
-
Keep agent sessions running when a provider fails
Set an ordered fallback list so a failed provider hands the request to the next model.
- My Free Code
- Software and DevOps
- Intermediate
View prompt
In the my-free-code repository, set MODEL_SONNET to <primary-model> and FALLBACK_MODELS to <fallback-model-1>,<fallback-model-2> in .env, then start the gateway with python -m my_free_code. Expected output: a test request completes using the primary model. Verify that the gateway falls through to the next model when the primary is made to fail before output.
-
Run coding agents against local models
Point the gateway at Ollama, LM Studio, or llama.cpp so requests stay on your machine.
- My Free Code
- Software and DevOps
- Advanced
View prompt
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.
-
Launch Codex through the local gateway
Start Codex with the gateway as its backend using the built-in launcher.
- My Free Code
- Codex
- Software and DevOps
- Intermediate
View prompt
In the my-free-code repository, confirm the codex command is on PATH, start the gateway with python -m my_free_code, then run python -m my_free_code.cli.mfc codex. Expected output: Codex starts and completes a short test task. Verify that the gateway log records the request.
How to use My Free Code
- Check you have what it needs: 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.
- Open hkqr/my-free-code on GitHub and read the README and license.
- Run
python -m venv .venv, then activate it withsource .venv/bin/activateon macOS or Linux. - Run
python -m pip install -r requirements.txt. - Run
cp .env.example .env, then set MODEL, MODEL_SONNET, MODEL_HAIKU, and MODEL_OPUS plus the matching provider API keys in .env. - Run
python -m my_free_codein one terminal and keep it running at http://127.0.0.1:8082.
These steps come from our top use case, Run Claude Code on other model providers, which also has a copy-paste agent prompt.
Get 5 new use cases every morning. Free, one short email, unsubscribe anytime.
Get them freeMy Free Code alternatives · Best AI repos for Software and DevOps
About this repo
- Who it is forDevelopers who already use a coding agent and want to route it to different or cheaper model providers, or to local models, without changing the agent itself.
- Why it is hot
- LanguagePython
- Sourcegithub.com/hkqr/my-free-code · Back to Hot repos
Requirements
- 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
Maintain My Free Code? Add the Featured on Deduped badge
Paste this into your README:
[](https://dedupedai.com/use-cases/hkqr-my-free-code/?ref=badge)
Questions about My Free Code
What is My Free Code?
My Free Code is an open-source Python gateway that lets Claude Code and other coding agents send requests to many AI model providers and local models through one local address. It is an open-source project on GitHub: https://github.com/hkqr/my-free-code.
Who is My Free Code for?
Developers who already use a coding agent and want to route it to different or cheaper model providers, or to local models, without changing the agent itself.
What can I do with My Free Code?
4 use cases so far, for example: Run Claude Code on other model providers; Keep agent sessions running when a provider fails; Run coding agents against local models. Each has steps and a copy-paste agent prompt.
What do I need to run My Free Code?
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.
What are alternatives to My Free Code?
Other hot AI repos in Software and DevOps: Harness2, iFixAi, Orca, Diagram Design, AI Memory.
Is My Free Code safe to run?
Deduped does not own, audit or vouch for it. Read the README and license, run it on your own systems first and review every command before you run it.