Can you run a coding agent for free with a local model?
Yes, if your computer has the memory for a capable model. The open source Codex CLI has a built-in local mode for Ollama and LM Studio, and Ollama documents running Claude Code against a model on your own machine. Neither needs a paid plan, which matters because Anthropic's Free plan does not include Claude Code.
Cite
CodeLifter Forum, "Can you run a coding agent for free with a local model?", https://codelifter.com/forum/posts/can-you-run-a-coding-agent-for-free-with-a-local-model/, accessed 2026-11-12.- CodeLifter editorsStaffStaff, CodeLifter ·
Is Claude Code free?
Not on its own terms. Anthropic's Claude Code overview says "Most surfaces require a Claude subscription or Anthropic Console account", where the Console is Anthropic's pay-per-use developer account. The Claude pricing page, opened on 16 October 2026, marks Claude Code as "No" for the Free plan and "Yes" for Pro, Max, Team and Enterprise; it listed Pro at $20 a month billed monthly on that date. The same overview adds that the terminal CLI, VS Code and JetBrains "also support third-party providers", which is the door the local route uses.
Which agents can you use without paying?
Here "free" means no subscription or API bill. Your hardware and electricity still cost something, and the next sections cover what a local model needs.
Agent Free route Source, read 16 October 2026 Codex CLI codex --osswith Ollama or LM Studio; also a Free ChatGPT plan with limited Codex useCodex advanced config, Codex pricing Claude Code Pointed at a local Ollama server, per Ollama's docs Ollama: Claude Code GitHub Copilot Copilot Free: 2,000 completions a month, agent mode, MCP and Copilot CLI included; cloud agent not included Copilot plans Aider, Cline Apache-2.0 clients that can talk to Ollama CodeLifter agents ledger, 15 October 2026 The Codex pricing page lists the Free plan at $0 a month with "GPT-6 Luna at Standard speed in the desktop app, subject to rollout". Its feature table covers Plus, Pro, Business, Enterprise and API keys, not Free, so check what Free unlocks in your own account before you plan around it. On Copilot Free, models come "through auto model selection only".
How do you run Codex on a local model?
Ollama is a local model runner, MIT licensed, that serves models on
localhost:11434. These steps follow Ollama's Codex page and the Codex configuration docs.- Install Ollama and the Codex CLI (
npm install -g @openai/codexis one of the documented methods). - Pull a model that supports tool calling, for example
ollama pull <model>. Tool calling is how the agent edits files and runs commands; a model without it can chat but cannot act. - Start Codex in local mode:
codex --oss, orcodex --oss -m <model>for a specific model.ollama launch codexdoes the same setup for you. - To make Ollama the default for every
--ossrun, addoss_provider = "ollama"to~/.codex/config.toml. The Codex docs note that without it the interactive CLI asks you to choose, andcodex exec"exits with an error". - Set the model's context window to at least 64k tokens. Ollama's page says so for Codex, and the Claude Code page asks for "64k+" too. Context window means how much text the model can hold at once.
- Avoid cloud models, whose names end in
cloudin Ollama's examples (gpt-oss:120b-cloud,gemma4:cloud). Those run on Ollama's servers, so your code would leave your machine.
How do you run Claude Code on a local model?
Ollama's Claude Code page gives a one-line start,
ollama launch claude, and a manual setup that replaces the Anthropic login with three environment variables:export ANTHROPIC_AUTH_TOKEN=ollama export ANTHROPIC_API_KEY="" export ANTHROPIC_BASE_URL=http://localhost:11434 claude --model <model>This is Ollama's documented setup, not Anthropic's. Anthropic's LLM gateway page warns that Claude Code adds capabilities with each release and a gateway that does not forward them "breaks the corresponding features". Ollama's own page says basic chat and file edits work with compatible models, and that hosted web search and advanced tool controls "are not fully supported". Expect gaps, and run
/statusinside Claude Code to confirm which endpoint it is using.What does a local model need?
Memory is the limit. The llama.cpp quantize README says models "are currently fully loaded into memory", and lists an 8B model at 4.58 GiB in the Q4_K_M format and 7.95 GiB in Q8_0. Quantisation stores each weight in fewer bits so the model fits in less memory, at some cost in quality. The CodeLifter local models page uses its own rough estimate (parameters times bits divided by 8, times 1.2) and the model sizes it checked on 15 October 2026; by that estimate a 31B model at 4 bits needs about 19 GB.
Quality is the other limit. A small model that fits a laptop will make more mistakes with tool calls and long files than the hosted models these agents were built around. Test on a throwaway branch before you trust it with real work. The local models prompt thread has the checks we apply to anything a local model writes, and the coding agents thread compares the three agents on more than price.
Short version
- Codex CLI runs local models with
codex --ossand an Ollama or LM Studio server. - Ollama documents a setup that runs Claude Code against a local model; Anthropic's Free plan does not include Claude Code.
- Copilot Free includes agent mode and Copilot CLI with monthly limits, on hosted models.
- Plan on enough memory to load the whole model, and a 64k context window.
- Skip model names ending in
cloudif your code must stay on your machine.
- Install Ollama and the Codex CLI (
Write something first.
Give people something to work with: at least 30 words on what happened and what you tried.
That is too long. Keep it under 6,000 characters.
Write the question as the title, 15 to 140 characters, no links.
Pick a category.
Add a name (2 to 40 characters, no links).
That email address does not look right.
That was quick. Read the thread, then try again.
The form expired. Reload the page and post again.
Something went wrong with the form. Reload and try again.
Please complete the check and post again.
Limit reached for now. Try again later.
This thread is closed to new replies.
This thread no longer accepts replies.
Something went wrong with the form. Reload and try again.
Post a reply or question first (name and email), then this browser can vote, edit and accept answers.
You cannot vote on your own post.
Only the author (within 30 days) or the forum team can do that.
That email already has an account. Use your sign-in link instead.
New accounts are paused for the moment. Try again later.
That was already posted.
2 answers
- CodeLifter editorsStaffStaff, CodeLifter ·
Is GitHub Copilot free for students? Yes, for verified students. GitHub's Copilot plans page, read on 16 October 2026, lists a Copilot Student plan, "Available to verified students", priced as free, with "an allowance of GitHub AI Credits". It includes the agents column with one exception, "Excludes third-party agents", and like Copilot Free it offers models "through auto model selection only", so you cannot choose a specific model. The same page says verified teachers and "maintainers of popular open source projects may be eligible for free access to Copilot Pro". Two conditions apply to the free tiers: GitHub says Copilot Free plans "are only available to individual developers who don't have access to Copilot through an organization or enterprise", so a school that already provides Copilot changes what you get, and the credit allowance runs out. Copilot is a hosted service, so your code goes to GitHub's models, not a local one. If your course forbids that, or forbids AI help entirely, a free plan does not change the rule; the thread on whether teachers can tell covers what is at stake.
- CodeLifter editorsStaffStaff, CodeLifter ·
How much memory do you need to run a local coding model? Enough to hold the whole model, plus room for its working context. The llama.cpp quantize README states that "memory and disk requirements are the same" because the model is fully loaded, so the file size is your floor. Its table for an 8-billion-parameter model gives 4.58 GiB at Q4_K_M (about 4.9 bits per weight) and 7.95 GiB at Q8_0 (about 8.5 bits). For a rough figure on other sizes, the CodeLifter local models page uses parameters times bits per weight divided by 8, then adds 20 percent; that is our estimate, not a vendor figure. One trap: mixture-of-experts models, which activate only part of the network per token, still count in full. Tencent's Hy3 card describes 295B parameters with 21B active, and all of it has to fit. Context needs memory too, and Ollama's Codex page asks for "a context window of at least 64k tokens", so load the model at that setting and read your runner's memory report before you start a task, instead of trusting the file size alone.