Qwen3 4B (Ollama) is a 2.5GB model that carries a 256K context, which is an unusual combination. The context window is 256K tokens (262,144), pricing is Free (self-hosted), and the 2507 refresh ships separate instruct and thinking tags at the same footprint. Inside Atlas, Qwen3 4B is a strong small_model and a weak build agent: coding depth is limited at 4B, so use it for titles, summaries, and cheap subagents.
How does Qwen3 4B (Ollama) fit 256K of context into 2.5GB?
Qwen3 4B (Ollama) advertises 256K tokens (262,144) on a 2.5GB download, which is more window per gigabyte than anything else in the Ollama library at this size. The weights are small; the attention window is not. Serving it takes roughly 4.5GB at short context.
Window and parameter count are separate axes, and Qwen3 4B (Ollama) is the clearest illustration of that in the Ollama library. Alibaba Qwen ships a 4B model whose nominal window matches models many times its size. For Atlas, the practical consequence is that a laptop with roughly 4.5GB of spare memory can register a model with limit.context 262144. Whether you should actually fill that window is a different question, and the answer is usually no, which the next section covers. The 2.5GB pull itself is `ollama pull qwen3:4b`.
What does it actually cost to use the full 256K window on Qwen3 4B?
Filling 256K tokens (262,144) on a 4B model blows the KV cache well past the 4.5GB weight-plus-overhead floor. Qwen3 4B (Ollama) is roughly 4.5GB to serve at short context only. Budget far more RAM if you intend to use the window, and start Ollama with a smaller num_ctx.
The advertised window on Qwen3 4B (Ollama) is a ceiling, not an operating point. Registering qwen3:4b with limit.context 262144 tells Atlas what the model claims. Starting Ollama with a smaller num_ctx and raising it as memory allows is what keeps the machine responsive. The KV cache scales with context length, and on a 2.5GB model the cache can dwarf the weights. Treat the 256K figure as headroom for the rare long session, and run day to day at a context your hardware can hold without swapping.
What is the difference between the qwen3:4b instruct and thinking tags?
Qwen3 4B (Ollama) ships separate 2507 instruct and thinking tags at identical size, so you can A/B reasoning behavior without changing hardware. Pull `ollama pull qwen3:4b-thinking` for explicit reasoning, same 2.5GB, or `ollama pull qwen3:4b` for the instruct behavior.
Whether a model reasons out loud before Atlas executes a tool call is a real design choice, and Qwen3 4B (Ollama) lets you test both sides of it at zero hardware cost. The thinking tag deliberates before emitting a tool call, which can improve the quality of an Atlas plan at the price of latency and tokens. The instruct tag answers directly. Because both tags are the same 2.5GB, you can pull both, register both, and use `/models` in the Atlas TUI to switch between them mid-session. Atlas lets you switch the active model and provider on the fly with favorites and recents.
Is Qwen3 4B good enough to be the Atlas build agent?
No. Coding depth is limited at 4B, so Qwen3 4B (Ollama) is a strong small_model and a weak build agent. Use it for Atlas titles, summaries, and cheap subagents while a larger local coder holds the model slot, which is exactly what the documented setup prescribes.
Atlas fans out work to subagents that can run in the foreground or in parallel background sessions, and not every subagent needs a large model behind it. Qwen3 4B (Ollama) is a good fit for the cheap ones: a background summarizer, a title generator, a subagent scanning output. It is a poor fit for the build agent that computes and applies unified diffs. Keep model pointed at a larger local coder and small_model on ollama/qwen3:4b, and the 256K window becomes useful for exactly the kind of long, shallow reading a cheap subagent does.
How do you keep Qwen3 4B and the Atlas code index fully local?
Run the Atlas codebase index through Ollama embeddings so the repo and its vectors never leave the box. Qwen3 4B (Ollama) is Free (self-hosted), and pairing it with a local embedder means the small_model calls and the retrieval layer both stay on the same 2.5GB-class local stack.
Atlas can build its code index with local Ollama embeddings, keeping code off third-party servers, and Atlas searches code with hybrid semantic and keyword retrieval fused by reciprocal rank fusion. Both halves of that search run against the local index once the embedder is Ollama. Add the ollama provider to atlas.json on @ai-sdk/openai-compatible with baseURL http://localhost:11434/v1, register qwen3:4b with limit.context 262144 and limit.output 8192, and the summarization traffic Atlas generates most often never touches a network. That is the real reason to keep a 2.5GB model resident.
Setup
- 01Pull it: ollama pull qwen3:4b (2.5GB). For explicit reasoning use ollama pull qwen3:4b-thinking, same size.
- 02Add the ollama provider to atlas.json on @ai-sdk/openai-compatible with baseURL http://localhost:11434/v1.
- 03Register qwen3:4b with limit.context 262144 and limit.output 8192.
- 04Start Ollama with a smaller num_ctx than 262144 and raise it as memory allows, because the KV cache grows with context.
- 05Use qwen3:4b as small_model for Atlas titles, summaries, and cheap subagents while a larger local coder holds the model slot.
- 06Run the codebase index through Ollama embeddings so the repo and its vectors never leave the box.
Frequently asked questions
- what is the context window of qwen3 4b in ollama
- Qwen3 4B (Ollama) has 256K tokens (262,144) of context on a 2.5GB download. Register it in atlas.json with limit.context 262144 and limit.output 8192, but start Ollama with a smaller num_ctx and raise it as memory allows.
- how much ram do i need to run qwen3 4b
- Roughly 4.5GB to serve Qwen3 4B (Ollama) at short context, which is laptop territory. Filling the full 256K window blows the KV cache well past that 4.5GB weight-plus-overhead floor, so budget far more RAM if you intend to use the window.
- qwen3 4b instruct vs thinking tag
- The 2507 refresh ships separate instruct and thinking tags for Qwen3 4B (Ollama) at identical 2.5GB size, so you can pick whether the model reasons out loud before Atlas executes a tool call, and A/B the behavior without changing hardware.
- can qwen3 4b be my main coding model in atlas
- Coding depth is limited at 4B, so Qwen3 4B (Ollama) is a strong small_model and a weak build agent. Use it for Atlas titles, summaries, and cheap subagents while a larger local coder holds the model slot.
- how much does qwen3 4b cost
- Qwen3 4B (Ollama) is Free (self-hosted). After the 2.5GB pull with ollama pull qwen3:4b there is no per-token charge, which is why it is a practical permanent small_model for Atlas.
- why does my machine slow down when i raise num_ctx on qwen3 4b
- Because the KV cache grows with context. Qwen3 4B (Ollama) is roughly 4.5GB to serve at short context, but pushing toward 256K tokens (262,144) blows the cache well past that floor. Start Ollama with a smaller num_ctx and raise it as memory allows.
- how do i add ollama as a provider in atlas.json
- Add the ollama provider to atlas.json on @ai-sdk/openai-compatible with baseURL http://localhost:11434/v1, then register qwen3:4b under its models map with limit.context 262144 and limit.output 8192.
Try Atlas in your terminal
The terminal-native AI coding agent. Free core, single binary.
Install AtlasRelated guides
Automate GitHub Issue and Pull Request Triage with Atlas (2026 Workflow)
How to automate GitHub issue and pull request triage with Atlas in 2026: the atlas github command checks the actor has admin or write permission before it does anything.
Atlas vs Codebuff: Terminal AI Coding Agents in 2026
Atlas and Codebuff are terminal AI coding agents for 2026. Compare Atlas's terminal-native TUI, permission-gated tools, and diff review with Codebuff's multi-agent system and flexible pricing.
Atlas for Erlang in 2026
Atlas is a terminal-native AI coding agent for Erlang/OTP in 2026. Run it in an app with a rebar.config, map supervisors and gen_server modules, review every diff.
Run Atlas Headless in CI with Atlas (2026 Workflow)
How to run Atlas headless in CI in 2026: atlas run sends one prompt and exits when the session goes idle, with --format json, --command, and --continue for pipeline steps.
Atlas for SQL in 2026
Atlas is a terminal-native AI coding agent for SQL in 2026. Run it in a repo with your migrations or .sql files, optimize a query, and review the diff before applying.
Atlas vs. Goose: Choosing Your AI Coding Agent in 2026
Compare Atlas and Goose for 2026. Atlas offers terminal-native TUI and code-specialized features. Goose provides shareable Recipes and 70+ MCP extensions for general agentic workflows.
Run the Test Suite and Triage the Failures with Atlas in 2026
How to triage a failing test suite with Atlas in 2026: bash truncates at 2000 lines or 50 KB and saves the full log, then grep groups failures by root cause.
Atlas for Bash in 2026
Atlas is a terminal-native AI coding agent for Bash in 2026, with shellcheck-aware suggestions. Harden a script or fix shellcheck warnings and review every diff.