Model guide
DeepSeek-Coder 6.7B Instruct
DeepSeek Coder 6.7B Instruct is a compact code-chat checkpoint for explanations, function generation and debugging exercises. Unlike StarCoder2’s base models, it expects instructions in a chat template. Keep an executable test next to the generated code; a plausible explanation is not evidence that the repair works.
At a glance
- Parameters
- 6.7B
- Accepts
- Text · Code
- Returns
- Text, including code
- Published context limit
- 16,384 tokens
- Model format
- safetensors · GGUF
- Software and download hosts
- Ollama. Follow the exact setup below; this list does not establish support for every format, input type or software version.
- Suggested compression
- Q4_K_M
- Model-weight download
- Q4_K_M weights · 4.08 GBTheBloke (community conversion)deepseek-coder-6.7b-instruct.Q4_K_M.gguf
- Languages
- English and Chinese natural-language training; multilingual code training
- License
- DeepSeek Model License
Will it fit?
DeepSeek-Coder 6.7B Instruct · Q4_K_M download. Fit depends on your computer, the app you run it in and the conversation length you need.
Check on your computerBest for
- Paste a short buggy function and its failing input. Ask for a corrected function, then execute your tests in a disposable project.
Choose something else when
- If you want changes across a repository, the chat checkpoint alone cannot read or edit your files.
First setup
After loading this coding model with the setup below, keep context at 4,096 tokens and cap the first reply at 512 tokens. Ask: Write a Python function unique_in_order(values) that removes duplicates while preserving first occurrence. For [3, 1, 3, 2, 1], what does it return? Check for [3, 1, 2], and inspect the empty-list and all-duplicate cases before running the code. Do not grant filesystem, network or shell access for this example. One correct snippet is not proof that a larger generated program works. See the model instructions.
This creates a 4,096-token copy of deepseek-coder:6.7b named deepseek-coder-6.7b-instruct-short-context. Save the following as a file named Modelfile in your working folder:
FROM deepseek-coder:6.7b
PARAMETER num_ctx 4096
Then run these commands from that folder:
ollama pull deepseek-coder:6.7b
ollama create deepseek-coder-6.7b-instruct-short-context -f ./Modelfile
ollama run deepseek-coder-6.7b-instruct-short-context
Run the example in Model-specific setup. While the model is loaded, run ollama ps in another terminal and check CONTEXT and PROCESSOR.
The recorded Ollama package is Q4_0: 3.83 GB of model weights. Use Ollama 0.40.18 or a supporting newer release. A Hugging Face GGUF or MLX checkpoint is a separate representation; choose the matching source and runner in the memory calculator.
See Ollama context settings and the Modelfile instructions.
Open LM Studio’s Discover tab, search for TheBloke/deepseek-coder-6.7B-instruct-GGUF, and download deepseek-coder-6.7b-instruct.Q4_K_M.gguf (Q4_K_M, 4.08 GB). See the download files. Select the file in Chat, set context to 4,096, then load it. Use the coding task above with its stated output cap and settings; check the ordered-deduplication result before trying a larger input. If it will not load, open LM Studio Model Will Not Load.
Open a terminal in the extracted llama.cpp release folder. On Windows, replace ./llama-server below with .\llama-server.exe:
./llama-server -hf TheBloke/deepseek-coder-6.7B-instruct-GGUF -hff deepseek-coder-6.7b-instruct.Q4_K_M.gguf -c 4096 --host 127.0.0.1 --port 8080
The server downloads the selected model. Wait for the model to load, then open http://127.0.0.1:8080 in your browser. Use the coding task above with its stated output cap and settings; check the ordered-deduplication result. Keep the server terminal open; press Ctrl+C there to stop the server. The file list identifies the exact download. If the command fails: Unknown architecture? Update the runner. Allocation failed? Retry with less context or a smaller weight file.
Load the model, start a fresh chat and time your usual prompt. Record time until the first useful word and time until the full answer. Note the processor, context and output length when comparing another run.
