Instructions to use deepseek-ai/deepseek-coder-6.7b-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use deepseek-ai/deepseek-coder-6.7b-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="deepseek-ai/deepseek-coder-6.7b-base")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("deepseek-ai/deepseek-coder-6.7b-base") model = AutoModelForCausalLM.from_pretrained("deepseek-ai/deepseek-coder-6.7b-base") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use deepseek-ai/deepseek-coder-6.7b-base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "deepseek-ai/deepseek-coder-6.7b-base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "deepseek-ai/deepseek-coder-6.7b-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/deepseek-ai/deepseek-coder-6.7b-base
- SGLang
How to use deepseek-ai/deepseek-coder-6.7b-base with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "deepseek-ai/deepseek-coder-6.7b-base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "deepseek-ai/deepseek-coder-6.7b-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "deepseek-ai/deepseek-coder-6.7b-base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "deepseek-ai/deepseek-coder-6.7b-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use deepseek-ai/deepseek-coder-6.7b-base with Docker Model Runner:
docker model run hf.co/deepseek-ai/deepseek-coder-6.7b-base
trained on old code
Unfortunately, it was trained on data dating before 2023.
"prompt":"write sveltekit code for a todo app"
"response": "Sure, below is a basic example of a Todo application in SvelteKit. This includes creating and deleting todos:\n\n1. Firstly, install SvelteKit if you haven't done so yet:\nbash\nnpx degit sveltejs/svelte-kit my-app\ncd my-app\nnpm install\n\n2. Create a new file src/routes/index.svelte for the todo app:\n\nsvelte\n<script>\n let todos = [];\n let inputValue = \"\";\n \n function addTodo() {\n if (inputValue !== \"\") {\n todos = [...todos, inputValue];\n inputValue = \"\";\n }\n }\n\n function deleteTodo(index) {\n todos = todos.filter((_, i) => i !== index);\n }\n</script>\n\n<input bind:value={inputValue} type=\"text\">\n<button on:click={addTodo}>Add Todo</button>\n\n<ul>\n {#each todos as todo, index (index)}\n <li>\n {todo} \n <button on:click={() => deleteTodo(index)}>Delete</button>\n </li>\n {/each}\n</ul>\n\n3. Run the application by using npm run dev command in your terminal and then opening localhost:5000 in your browser to view the result.\n\nThis is a very basic example, you may want to persist data (like saving todos to a database) or handle errors/edge cases based on your needs. For that, SvelteKit provides several features like actions and stores which can be used as per requirements.\n",
This is not recent sveltekit (routes/+page.svelte, ...).
So sad, it's a pretty fast model.