[GH-ISSUE #1040] Add the deepseek model to the library #507

Closed
opened 2026-04-12 10:12:12 -05:00 by GiteaMirror · 9 comments
Owner

Originally created by @Nan-Do on GitHub (Nov 8, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/1040

The deepseek model is currently the best coding open source model on the HumanEval dataset second only to ChatGPT4 by a little margin.
https://www.deepseek.com/
https://huggingface.co/deepseek-ai
https://huggingface.co/deepseek-ai/deepseek-coder-6.7b-instruct
https://huggingface.co/deepseek-ai/deepseek-coder-33b-instruct
https://evalplus.github.io/leaderboard.html

There are 7b and 33b model variants, the quantized versions can be found here:
https://huggingface.co/TheBloke/deepseek-coder-6.7B-instruct-GGUF
https://huggingface.co/TheBloke/deepseek-coder-33B-instruct-GGUF

This is a possible valid modelfile including a valid prompt template:

FROM ./deepseek-coder-33b-instruct.Q4_K_M.gguf

# set the temperature to 1 [higher is more creative, lower is more coherent]
PARAMETER temperature 0.2

# set the system prompt
TEMPLATE """{{ .System }}

### Instruction:
{{ .Prompt }}

### Response:
"""

SYSTEM """You are an advanced AI programming assistant."""

The authors propose a longer version of this template, which is more restrictive, as well as other variants for other kinds of inference
https://github.com/deepseek-ai/deepseek-coder#3-chat-model-inference

Originally created by @Nan-Do on GitHub (Nov 8, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/1040 The deepseek model is currently the best coding open source model on the HumanEval dataset second only to ChatGPT4 by a little margin. https://www.deepseek.com/ https://huggingface.co/deepseek-ai https://huggingface.co/deepseek-ai/deepseek-coder-6.7b-instruct https://huggingface.co/deepseek-ai/deepseek-coder-33b-instruct https://evalplus.github.io/leaderboard.html There are 7b and 33b model variants, the quantized versions can be found here: https://huggingface.co/TheBloke/deepseek-coder-6.7B-instruct-GGUF https://huggingface.co/TheBloke/deepseek-coder-33B-instruct-GGUF This is a possible valid modelfile including a valid prompt template: ``` FROM ./deepseek-coder-33b-instruct.Q4_K_M.gguf # set the temperature to 1 [higher is more creative, lower is more coherent] PARAMETER temperature 0.2 # set the system prompt TEMPLATE """{{ .System }} ### Instruction: {{ .Prompt }} ### Response: """ SYSTEM """You are an advanced AI programming assistant.""" ``` The authors propose a longer version of this template, which is more restrictive, as well as other variants for other kinds of inference https://github.com/deepseek-ai/deepseek-coder#3-chat-model-inference
GiteaMirror added the model label 2026-04-12 10:12:12 -05:00
Author
Owner

@eramax commented on GitHub (Nov 8, 2023):

Yes please add it.

<!-- gh-comment-id:1802389510 --> @eramax commented on GitHub (Nov 8, 2023): Yes please add it.
Author
Owner

@valentimarco commented on GitHub (Nov 17, 2023):

+1

<!-- gh-comment-id:1817123431 --> @valentimarco commented on GitHub (Nov 17, 2023): +1
Author
Owner

@daniel-a-diaz commented on GitHub (Nov 19, 2023):

I was just about to write this feature request. Please add.

<!-- gh-comment-id:1817748034 --> @daniel-a-diaz commented on GitHub (Nov 19, 2023): I was just about to write this feature request. Please add.
Author
Owner

@kapral18 commented on GitHub (Nov 19, 2023):

+1

<!-- gh-comment-id:1817973752 --> @kapral18 commented on GitHub (Nov 19, 2023): +1
Author
Owner

@gururise commented on GitHub (Nov 19, 2023):

Any movement on this? Would love to use deepseek coder as a coding assistant and Ollama as the server. Would work great with the 'continue' vscode extension!

<!-- gh-comment-id:1818010910 --> @gururise commented on GitHub (Nov 19, 2023): Any movement on this? Would love to use deepseek coder as a coding assistant and Ollama as the server. Would work great with the '[continue](https://continue.dev/docs/reference/Models/ollama)' vscode extension!
Author
Owner

@Nan-Do commented on GitHub (Nov 20, 2023):

Just a reminder for anyone interested in using this model, you can still download the model and use the ollama create command to add it to your local repository of models.
https://github.com/jmorganca/ollama/blob/main/docs/modelfile.md.

This is a short recipe to run the 7B model:

wget https://huggingface.co/TheBloke/deepseek-coder-6.7B-instruct-GGUF/resolve/main/deepseek-coder-6.7b-instruct.Q4_K_M.gguf

Create the modelfile, with the following contents, in the same directory you downloaded the model.

FROM ./deepseek-coder-6.7b-instruct.Q4_K_M.gguf

# set the temperature to 1 [higher is more creative, lower is more coherent]
PARAMETER temperature 0.1

# set the system prompt
TEMPLATE """{{ .System }}

### Instruction:
{{ .Prompt }}

### Response:
"""

SYSTEM """You are an advanced AI programming assistant."""

Run the ollama create command.

ollama create deepseek-7B -f ./modelfile

Use the model.

ollama run deepseek-7B
<!-- gh-comment-id:1818147154 --> @Nan-Do commented on GitHub (Nov 20, 2023): Just a reminder for anyone interested in using this model, you can still download the model and use the ollama create command to add it to your local repository of models. https://github.com/jmorganca/ollama/blob/main/docs/modelfile.md. This is a short recipe to run the 7B model: ``` wget https://huggingface.co/TheBloke/deepseek-coder-6.7B-instruct-GGUF/resolve/main/deepseek-coder-6.7b-instruct.Q4_K_M.gguf ``` Create the modelfile, with the following contents, in the same directory you downloaded the model. ``` FROM ./deepseek-coder-6.7b-instruct.Q4_K_M.gguf # set the temperature to 1 [higher is more creative, lower is more coherent] PARAMETER temperature 0.1 # set the system prompt TEMPLATE """{{ .System }} ### Instruction: {{ .Prompt }} ### Response: """ SYSTEM """You are an advanced AI programming assistant.""" ``` Run the ollama create command. ``` ollama create deepseek-7B -f ./modelfile ``` Use the model. ``` ollama run deepseek-7B ```
Author
Owner

@mxyng commented on GitHub (Nov 21, 2023):

DeepSeek Coder is now available in the Ollama library

<!-- gh-comment-id:1820002747 --> @mxyng commented on GitHub (Nov 21, 2023): DeepSeek Coder is now [available](https://ollama.ai/library/deepseek-coder) in the Ollama library
Author
Owner

@Nan-Do commented on GitHub (Nov 21, 2023):

Just a comment for people interested in using this model, with the current configuration you'll need a graphic card with at least 16GB of VRAM (for the 6.7GB) in order to be able to use this model with GPU acceleration

<!-- gh-comment-id:1820206688 --> @Nan-Do commented on GitHub (Nov 21, 2023): Just a comment for people interested in using this model, with the current configuration you'll need a graphic card with at least 16GB of VRAM (for the 6.7GB) in order to be able to use this model with GPU acceleration
Author
Owner

@ex3ndr commented on GitHub (Nov 22, 2023):

Base models are very interesting to have too
https://huggingface.co/deepseek-ai/deepseek-coder-6.7b-base
https://huggingface.co/deepseek-ai/deepseek-coder-33b-base

<!-- gh-comment-id:1823132276 --> @ex3ndr commented on GitHub (Nov 22, 2023): Base models are very interesting to have too https://huggingface.co/deepseek-ai/deepseek-coder-6.7b-base https://huggingface.co/deepseek-ai/deepseek-coder-33b-base
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#507