If you’ve been searching for a compact yet powerful code reasoning model that can compete with giants like OpenAI’s o3-mini, DeepCoder-14B-Preview may blow your mind. This 14B parameter LLM isn’t just another code model; it’s been rigorously fine-tuned from DeepSeek-R1-Distilled-Qwen-14B using advanced reinforcement learning techniques (GRPO+). With an outstanding 60.6% Pass@1 accuracy on LiveCodeBench v5, DeepCoder outperforms its base model by 8% and proves it can scale effectively to 64K context lengths, making it a powerhouse for long-context reasoning. DeepCoder is purpose-built for developers looking to push the boundaries of code generation and understanding.
In this guide, we’ll show you how to install and run DeepCoder-14B locally using Ollama, a lightweight and hassle-free way to serve this LLM on your machine. Let’s get you coding with DeepCoder in minutes.
Prerequisites
The minimum system requirements for this use case are:
- GPUs: RTX 4090 or RTX A6000
- Disk Space: 100 GB
- RAM: At least 8 GB.
- Anaconda set up
Note: The prerequisites for this are highly variable across use cases. A high-end configuration could be used for a large-scale deployment.
Step-by-step process to install and run DeepCoder-14B Preview locally
For the purpose of this tutorial, we’ll use a GPU-powered Virtual Machine by NodeShift since it provides high compute Virtual Machines at a very affordable cost on a scale that meets GDPR, SOC2, and ISO27001 requirements. Also, it offers an intuitive and user-friendly interface, making it easier for beginners to get started with Cloud deployments. However, feel free to use any cloud provider of your choice and follow the same steps for the rest of the tutorial.
Step 1: Setting up a NodeShift Account
Visit app.nodeshift.com and create an account by filling in basic details, or continue signing up with your Google/GitHub account.
If you already have an account, login straight to your dashboard.
Step 2: Create a GPU Node
After accessing your account, you should see a dashboard (see image), now:
- Navigate to the menu on the left side.
- Click on the GPU Nodes option.
- Click on Start to start creating your very first GPU node.
These GPU nodes are GPU-powered virtual machines by NodeShift. These nodes are highly customizable and let you control different environmental configurations for GPUs ranging from H100s to A100s, CPUs, RAM, and storage, according to your needs.
Step 3: Selecting configuration for GPU (model, region, storage)
- For this tutorial, we’ll be using the RTX 4090 GPU; however, you can choose any GPU of your choice based on your needs.
- Similarly, we’ll opt for 200GB storage by sliding the bar. You can also select the region where you want your GPU to reside from the available ones.
Step 4: Choose GPU Configuration and Authentication method
- After selecting your required configuration options, you’ll see the available GPU nodes in your region and according to (or very close to) your configuration. In our case, we’ll choose a 1x RTX A6000 48GB GPU node with 64vCPUs/63GB RAM/200GB SSD.
2. Next, you’ll need to select an authentication method. Two methods are available: Password and SSH Key. We recommend using SSH keys, as they are a more secure option. To create one, head over to our official documentation.
Step 5: Choose an Image
The final step would be to choose an image for the VM, which in our case is Nvidia Cuda, where we’ll deploy and run the inference of our model.
That’s it! You are now ready to deploy the node. Finalize the configuration summary, and if it looks good, click Create to deploy the node.
Step 6: Connect to active Compute Node using SSH
- As soon as you create the node, it will be deployed in a few seconds or a minute. Once deployed, you will see a status Running in green, meaning that our Compute node is ready to use!
- Once your GPU shows this status, navigate to the three dots on the right and click on Connect with SSH. This will open a pop-up box with the Host details. Copy and paste that in your local terminal to connect to the remote server via SSH.
As you copy the details, follow the below steps to connect to the running GPU VM via SSH:
- Open your terminal, paste the SSH command, and run it.
2. In some cases, your terminal may take your consent before connecting. Enter ‘yes’.
3. A prompt will request a password. Type the SSH password, and you should be connected.
Output:
Next, If you want to check the GPU details, run the following command in the terminal:
!nvidia-smi
Output:
Step 7: Install Ollama
- Update the Ubuntu package source list.
apt update
Output:
2. Install the dependencies for Ollama to detect and use GPU resources.
apt install pciutils lshw
Output:
3. Install Ollama with curl command.
curl -fsSL https://ollama.com/install.sh | sh
Output:
Step 8: Download and run the model
- Start the Ollama server with the following command.
ollama serve
Output:
2. Open another local terminal and connect it to SSH (if using a remote server, e.g., NodeShift).
3. Run the following command to download the model.
ollama run deepcoder
Output:
4. Once downloaded you can write your prompt in the search console.
Prompt: Write the code to split a document into overlapping chunks for a RAG pipeline.
Output:
The code generated by the model:
import os
import PyPDF2
from docx import Document
from newspaper import Article
import spacy
# Load spaCy English model (download with: python -m spacy download
en_core_web_sm)
nlp = spacy.load("en_core_web_sm")
def read_file(file_path):
"""Reads a file and returns its text content."""
extension = os.path.splitext(file_path)[1]
if extension == ".txt":
with open(file_path, "r", encoding="utf-8") as f:
return f.read()
elif extension == ".pdf":
with open(file_path, "rb") as f:
pdf_reader = PyPDF2.PdfReader(f)
text = ""
for page in pdf_reader.pages:
text += page.extract_text()
return text
elif extension == ".docx":
doc = Document(file_path)
return "\n".join([paragraph.text for paragraph in doc.paragraphs])
else:
raise ValueError("Unsupported file type. Supported formats: .txt,
.pdf, .docx")
def split_into_chunks(text, max_tokens=1000, overlap_ratio=0.5):
"""Splits the text into overlapping chunks based on token count and
overlap ratio."""
# Convert the text into tokens (words or sentences)
doc = nlp(text)
chunks = []
current_chunk = []
current_token_count = 0
# Calculate the number of overlapping tokens
overlap_tokens = int(max_tokens * overlap_ratio)
for token in doc:
if token.is_space:
continue
# Add each token to the current chunk
current_chunk.append(token.text_with_ws)
current_token_count += 1
# Check if we've reached the max tokens or need to split due to
overlap
if (current_token_count >= max_tokens and
len(chunks) == 0) or \
(current_token_count >= max_tokens + overlap_tokens):
chunk_text = "".join(current_chunk)
chunks.append(chunk_text.strip())
# Reset current chunk for the next part, but keep some tokens
overlapping
if len(chunks) > 0:
# Calculate how many tokens to keep for overlap
start_index = max(0, (current_token_count - overlap_tokens))
current_chunk = [token.text_with_ws for token in
doc[start_index:]]
current_token_count = start_index
# Add the remaining text as the last chunk if it's not empty
if len(current_chunk) > 0:
chunk_text = "".join(current_chunk)
chunks.append(chunk_text.strip())
return chunks
# Example usage:
if name == "main":
import argparse
parser = argparse.ArgumentParser(description='Split a document into
overlapping chunks for RAG pipeline.')
parser.add_argument('--file', type=str, required=True,
help='Path to the input file (supported formats: .txt,
.pdf, .docx)')
parser.add_argument('--url', type=str,
help='URL of a web article')
parser.add_argument('--max_tokens', type=int, default=1000,
help='Maximum number of tokens per chunk')
parser.add_argument('--overlap_ratio', type=float, default=0.5,
help='Overlap ratio between chunks (between 0 and 1)')
args = parser.parse_args()
# Read the text from file or URL
if args.url:
article = Article(args.url)
article.download()
article.parse()
text = article.text
else:
text = read_file(args.file)
# Split into chunks
chunks = split_into_chunks(text, max_tokens=args.max_tokens,
overlap_ratio=args.overlap_ratio)
# Print the chunks
for i, chunk in enumerate(chunks):
print(f"Chunk {i+1}:\n{chunk}\n{'-'*50}")
Conclusion
By now, you’ve seen how straightforward it is to install and run DeepCoder-14B locally using Ollama, from setting up the environment to pulling the model and testing it with real prompts. If you’re exploring advanced code reasoning or building powerful dev tools, this setup gives you a easy to start and solid foundation. And if you’re looking to scale beyond, NodeShift Cloud makes it even easier, offering scalable environments optimized for LLM workloads, faster deployment pipelines, and seamless GPU access. It’s the perfect match for developers who want to go from local testing to production-ready inference in no time.