Begin with a model that fits and a coding task you can check. Try Qwen3.5 4B for short repairs. Compare MiMo-V2.6 9B (mimo-v2.6:9b-q4_K_M, about 6.6 GB including image weights) against Qwen2.5-Coder 7B on the same repair. Check actual tool-call format before granting edit permissions; a chat reply does not show tool calls work. Qwen2.5-Coder 7B remains the text-only baseline for the four checks below. Compare Gemma 4 12B (gemma4:12b-it-q4_K_M, about 8 GB) with Qwen3.8 27B (qwen3.8:27b-q4_K_M, about 18 GB) on a larger machine. The latter is a stretch candidate, not a default for 16 GB shared memory. Allow for all weights, context, runner and other applications.
This guide suits people who want explanations, small edits, tests, or help understanding error messages on their own computer. For an app that can edit files and run commands, use the local coding agents guide after the direct model test succeeds.
Pick the task before the model
| What you want | What matters most |
|---|---|
| Explain a short function | Clear instructions and enough room for the function |
| Write or repair one function | Code-focused training and tests you can run |
| Suggest completions in an editor | The extension's completion format and support for the model |
| Edit a repository through an agent | Tool use, reliable edits, larger context, and the host app's model requirements |
| Discuss a new library release | Current documentation supplied in the prompt or through an approved tool |
An Instruct model is intended to follow conversational instructions. A completion model and a model used for tool calls may need different prompt formats. A similarly named base checkpoint behaves differently.
Download one exact model
For newer candidates run ollama run qwen3.5:4b-q4_K_M or ollama run mimo-v2.6:9b-q4_K_M and use 4,096 tokens initially. check memory or check memory before downloading. Repeat the four checks below. For autocomplete test prefix and suffix using a FIM model; for an agent additionally verify tool calls, the diff and real test results.
Check Qwen2.5-Coder 7B Instruct in the memory calculator before downloading. For the 7B trial select Q4, one user and 4,096 tokens. Enter the RAM and dedicated VRAM or unified memory you have. Set the runner to the app you will use. If Ollama loads a different context, read CONTEXT in ollama ps and recalculate using that value.
Choose one app you already have working. If you need the first setup, follow install LM Studio or install Ollama, including their first-chat checks, before using the coding model:
- LM Studio: Open Discover, search for the publisher and repository
Qwen/Qwen2.5-Coder-7B-Instruct-GGUF, and select the single fileqwen2.5-coder-7b-instruct-q4_k_m.gguf. Qwen's file list also contains split files with similar names; choose the single file for this example. Download it, open a new chat, select the downloaded model, and load it with a modest context if the load controls offer that choice. - Ollama: Run
ollama run qwen2.5-coder:7bin a terminal. The first run downloads the model; later runs can reuse it. Useollama listto confirm the tag is installed. While the model is loaded, runollama psin another terminal and read itsCONTEXTandPROCESSORcolumns. If the model cannot load, follow memory troubleshooting and Ollama's context instructions to reduce the serving context; the 4,096-token estimate does not establish that the larger allocation fits.
The Ollama tag is a packaged Q4_K_M download, while the named GGUF is a separate publisher file. Their names, file sizes, and results differ.
If 7B does not fit, consider Qwen3 4B at a supported four-bit setting, then repeat the same small task. Qwen's cards identify the original Qwen3 4B and Qwen2.5-Coder 7B Instruct under Apache 2.0.
If you already have a Code Llama workflow, Code Llama 7B Instruct is another checkpoint to compare on the small function exercise below; the base completion variant is a different checkpoint. On a higher-memory machine, DeepSeek-Coder-V2 Lite Instruct provides a different coding candidate. Its expert-routing design still stores about 16B parameters, not just the active parameters. Check the exact download and runtime before deciding it fits, and do not infer coding-agent support from a successful standalone code answer.
Repair one function and check the answer
Open a fresh chat with the downloaded model. Give it this deliberately flawed Python function:
def unique_in_order(values):
return sorted(set(values))
Ask: “Change only this function so it removes duplicate strings while keeping their first-seen order and original case. It must leave the input unchanged and return an empty list for an empty input. Return the complete corrected function and briefly explain the change.” The original sorts the values, so ['B', 'A', 'B'] comes back in the wrong order.
Read the proposed code before running it. In a scratch folder, place the corrected function in trial.py and add these independent checks below it:
sample = ['B', 'A', 'B']
assert unique_in_order(sample) == ['B', 'A']
assert sample == ['B', 'A', 'B']
assert unique_in_order(['A', 'a', 'A']) == ['A', 'a']
assert unique_in_order([]) == []
print('The four checks passed')
Run python trial.py, or python3 trial.py if that is how Python is installed on your computer. A useful first result prints “The four checks passed.” An assertion error means the proposed function missed a requirement; a Python error means the copied code or environment needs correction. Fix the cause and rerun the same checks.
Check that the downloaded model remains usable after the first chat. In LM Studio, quit and reopen the app, select the model again, and ask why the original function fails for ['B', 'A', 'B']. With the Ollama terminal path, including Linux, leave the chat, open a new terminal, and run ollama run qwen2.5-coder:7b again before asking the same question. It should reuse the installed model. For real project work, remove secrets, supply the language and library version with the relevant code and error, request a small change, review the diff, and run your project's own checks.
Know the common failure modes
- Invented library calls: supply the current API documentation. A larger model does not know a recent release.
- Wrong edit format or ignored tools: check the editor or agent's required model capability.
- Lost requirements: shorten the prompt, include the relevant files, and check context length.
- Very slow replies: reduce model size or context and inspect whether the model is actually using the GPU.
- The download or load fails: use download troubleshooting or memory troubleshooting before trying a larger model.
- Unwanted reasoning text: use the app's supported reasoning controls for that exact model rather than deleting arbitrary text from the answer.
Stop an agent if it repeatedly makes unrelated edits or runs unexpected commands. Improve the task and inspect the changes before granting it more access.
Sources
- Qwen2.5-Coder 7B Instruct: model information and license
- Qwen: official 7B Instruct GGUF downloads
- Qwen3 4B: model information and thinking controls
- Ollama: Qwen2.5-Coder 7B download
- LM Studio: finding a model and choosing a download
- Ollama: context length
- Ollama: command-line model and process checks
- Ollama: Linux service and terminal setup
