DEDUPED Hot AI repos, turned into use cases Get 5 a day

How to run coding agents against local models with My Free Code

Point the gateway at Ollama, LM Studio, or llama.cpp so requests stay on your machine.

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

  1. 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.
  2. Run cp .env.example .env and set OLLAMA_BASE_URL, LM_STUDIO_BASE_URL, or LLAMACPP_BASE_URL plus MODEL to the matching local model, such as ollama/llama3.1.
  3. Run python -m my_free_code to start the gateway.
  4. Run python -m my_free_code.cli.mfc claude or another launcher command from the README to connect your agent.
  5. 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.

Share: X LinkedIn Hacker News Email Copy link

Disclaimer

Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page