Instructions to use DQN-Labs/dqnCode-v0.2-1.5B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use DQN-Labs/dqnCode-v0.2-1.5B with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="DQN-Labs/dqnCode-v0.2-1.5B", filename="DQN-Code-v0.2-1.5B.Q4_K_M.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use DQN-Labs/dqnCode-v0.2-1.5B with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf DQN-Labs/dqnCode-v0.2-1.5B:Q4_K_M # Run inference directly in the terminal: llama-cli -hf DQN-Labs/dqnCode-v0.2-1.5B:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf DQN-Labs/dqnCode-v0.2-1.5B:Q4_K_M # Run inference directly in the terminal: llama-cli -hf DQN-Labs/dqnCode-v0.2-1.5B:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf DQN-Labs/dqnCode-v0.2-1.5B:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf DQN-Labs/dqnCode-v0.2-1.5B:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf DQN-Labs/dqnCode-v0.2-1.5B:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf DQN-Labs/dqnCode-v0.2-1.5B:Q4_K_M
Use Docker
docker model run hf.co/DQN-Labs/dqnCode-v0.2-1.5B:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use DQN-Labs/dqnCode-v0.2-1.5B with Ollama:
ollama run hf.co/DQN-Labs/dqnCode-v0.2-1.5B:Q4_K_M
- Unsloth Studio new
How to use DQN-Labs/dqnCode-v0.2-1.5B with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for DQN-Labs/dqnCode-v0.2-1.5B to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for DQN-Labs/dqnCode-v0.2-1.5B to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for DQN-Labs/dqnCode-v0.2-1.5B to start chatting
- Pi new
How to use DQN-Labs/dqnCode-v0.2-1.5B with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf DQN-Labs/dqnCode-v0.2-1.5B:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "DQN-Labs/dqnCode-v0.2-1.5B:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use DQN-Labs/dqnCode-v0.2-1.5B with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf DQN-Labs/dqnCode-v0.2-1.5B:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default DQN-Labs/dqnCode-v0.2-1.5B:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use DQN-Labs/dqnCode-v0.2-1.5B with Docker Model Runner:
docker model run hf.co/DQN-Labs/dqnCode-v0.2-1.5B:Q4_K_M
- Lemonade
How to use DQN-Labs/dqnCode-v0.2-1.5B with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull DQN-Labs/dqnCode-v0.2-1.5B:Q4_K_M
Run and chat with the model
lemonade run user.dqnCode-v0.2-1.5B-Q4_K_M
List all available models
lemonade list
π§ DQN Code v0.2
A 1.5B Python Specialist
DQN Code v0.2 is a lightweight coding-focused model built on Qwen2.5-1.5B-Instruct and fine-tuned specifically for high-quality Python generation.
This release focuses on algorithmic correctness, structured implementation, and clean function completion.
π Highlights
- πΉ 1.5B parameters
- πΉ LoRA fine-tuned
- πΉ Python-specialized
- πΉ Optimized for deterministic completion
- πΉ Designed to run locally on 8GB systems
π Benchmark Performance
HumanEval (0-shot, temperature=0.0)
Evaluated using mlx_lm.
| Model | Parameters | HumanEval pass@1 |
|---|---|---|
| Qwen2.5-1.5B-Instruct (official) | 1.5B | ~37.8% |
| MistralAI Mistral 7B | 7B | ~30.5% |
| Google Gemma 2 9B (as on llmstats.com) | 9B | ~40.2% |
| DQN Code v0.2 | 1.5B | 49.39% |
Evaluation settings:
- 0-shot
- Temperature = 0.0
- No few-shot prompting
- Full 164 HumanEval tasks
This represents a +11.6% absolute improvement over the base Instruct model.
π― Design Philosophy
Instead of scaling parameters, DQN Code focuses on:
- High-quality distilled supervision
- Python-heavy training distribution
- Clean function-style completions
- Reduced conversational overhead
- Local inference efficiency
Small models benefit heavily from specialization.
This release demonstrates how targeted fine-tuning can significantly improve coding performance without increasing model size.
π§ Training Details
- Base:
Qwen2.5-1.5B-Instruct - Fine-tune type: LoRA
- Effective batch size: 8
- Max sequence length: 512
- Optimizer: AdamW
- Learning rate: 5e-6
- Dataset size: ~1.8k curated Python-focused samples
- Training hardware: 8GB RAM system (MLX)
Training focused on:
- Function completion
- Algorithmic correctness
- Clean Python structure
- Reduced hallucinated commentary
π» Intended Use
- Local coding assistant (with decent performance in other languages too!)
- Python function completion
- Algorithm practice
- Educational use
- Lightweight code generation
β Limitations
- Primarily optimized for Python (but performs well on other languages too.)
- Not benchmarked on multi-language coding
- Limited evaluation on mathematical reasoning
- Not trained for tool use or multi-step planning
π Philosophy
Powerful coding models do not require massive infrastructure. You don't need a datacenter at home!
Focused training + efficient inference can deliver strong results on modest hardware.
β Queries
If you have any questions regarding the model, want to know how it was trained and our pipleine process, how you can make a better version of the model, or you just want to chat about AI, feel free to contact me on Discord at @dqnlabs.
Enjoy this model, for this is the best so far. There's more coming.
-- DQN Labs
This model card was made with the assistance of dqnGPT-v0.1-7B :D
- Downloads last month
- 38
4-bit
16-bit