Text Generation
Safetensors
GGUF
English
qwen2
code
coding-assistant
lora
fine-tuned
ollama
conversational
Instructions to use NavitraTechnologies01/tn_01_base_coder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use NavitraTechnologies01/tn_01_base_coder with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf NavitraTechnologies01/tn_01_base_coder:Q4_K_M # Run inference directly in the terminal: llama cli -hf NavitraTechnologies01/tn_01_base_coder:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf NavitraTechnologies01/tn_01_base_coder:Q4_K_M # Run inference directly in the terminal: llama cli -hf NavitraTechnologies01/tn_01_base_coder: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 NavitraTechnologies01/tn_01_base_coder:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf NavitraTechnologies01/tn_01_base_coder: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 NavitraTechnologies01/tn_01_base_coder:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf NavitraTechnologies01/tn_01_base_coder:Q4_K_M
Use Docker
docker model run hf.co/NavitraTechnologies01/tn_01_base_coder:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use NavitraTechnologies01/tn_01_base_coder with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NavitraTechnologies01/tn_01_base_coder" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NavitraTechnologies01/tn_01_base_coder", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/NavitraTechnologies01/tn_01_base_coder:Q4_K_M
- Ollama
How to use NavitraTechnologies01/tn_01_base_coder with Ollama:
ollama run hf.co/NavitraTechnologies01/tn_01_base_coder:Q4_K_M
- Unsloth Studio
How to use NavitraTechnologies01/tn_01_base_coder 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 NavitraTechnologies01/tn_01_base_coder 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 NavitraTechnologies01/tn_01_base_coder to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for NavitraTechnologies01/tn_01_base_coder to start chatting
- Pi
How to use NavitraTechnologies01/tn_01_base_coder with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf NavitraTechnologies01/tn_01_base_coder: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": "NavitraTechnologies01/tn_01_base_coder:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- OpenClaw new
How to use NavitraTechnologies01/tn_01_base_coder with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf NavitraTechnologies01/tn_01_base_coder:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "NavitraTechnologies01/tn_01_base_coder:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- Docker Model Runner
How to use NavitraTechnologies01/tn_01_base_coder with Docker Model Runner:
docker model run hf.co/NavitraTechnologies01/tn_01_base_coder:Q4_K_M
- Lemonade
How to use NavitraTechnologies01/tn_01_base_coder with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull NavitraTechnologies01/tn_01_base_coder:Q4_K_M
Run and chat with the model
lemonade run user.tn_01_base_coder-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use NavitraTechnologies01/tn_01_base_coder with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf NavitraTechnologies01/tn_01_base_coder: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 NavitraTechnologies01/tn_01_base_coder:Q4_K_M
Run Hermes
hermes
- Atomic Chat
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,115 +1,86 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
|
| 5 |
-
|
| 6 |
|
| 7 |
-
|
| 8 |
|
| 9 |
-
|
| 10 |
-
2. Prepare high-quality coding instruction data.
|
| 11 |
-
3. Fine-tune with QLoRA, then quantize/deploy.
|
| 12 |
|
| 13 |
-
|
|
|
|
| 14 |
|
| 15 |
-
|
| 16 |
|
| 17 |
-
-
|
| 18 |
-
-
|
| 19 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
-
|
| 22 |
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
-
|
| 26 |
|
| 27 |
-
|
| 28 |
-
- Prefer Q3 or Q4 quantization for local inference. Higher precision will likely exceed comfortable memory limits.
|
| 29 |
-
- Keep context length modest at first, such as 4K-16K tokens. Long context can consume a lot of memory.
|
| 30 |
-
- Do not plan to QLoRA fine-tune the 30B model locally. Use a rented NVIDIA GPU for that phase.
|
| 31 |
-
- For local fine-tuning experiments, use a smaller model first, such as a 7B coder model.
|
| 32 |
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
-
|
| 36 |
-
2. Use a cloud GPU to fine-tune Qwen3-Coder-30B-A3B-Instruct with QLoRA.
|
| 37 |
-
3. Bring the resulting adapter or merged/quantized model back to the Mac for local inference.
|
| 38 |
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
Specialist dataset strategy: `docs/dataset-strategy.md`.
|
| 44 |
-
|
| 45 |
-
Baseline findings: `docs/baseline-findings.md`.
|
| 46 |
-
|
| 47 |
-
Light deployment strategy: `docs/light-deployment-strategy.md`.
|
| 48 |
-
|
| 49 |
-
Runtime system prompt: `prompts/product_engineer_system.md`.
|
| 50 |
-
|
| 51 |
-
Complex benchmark findings: `docs/complex-benchmark-findings.md`.
|
| 52 |
-
|
| 53 |
-
Current performance report: `docs/current-performance-report.md`.
|
| 54 |
-
|
| 55 |
-
## Install
|
| 56 |
-
|
| 57 |
-
```bash
|
| 58 |
-
cd qwen-coder-lab
|
| 59 |
-
python3 -m venv .venv
|
| 60 |
-
source .venv/bin/activate
|
| 61 |
-
pip install -r requirements.txt
|
| 62 |
-
```
|
| 63 |
-
|
| 64 |
-
If macOS reports missing Command Line Tools when running `python3`, install them with `xcode-select --install`, or use a `uv` Python environment instead.
|
| 65 |
-
|
| 66 |
-
## Run Chat Inference
|
| 67 |
|
| 68 |
```bash
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
--load-in-4bit
|
| 72 |
-
```
|
| 73 |
-
|
| 74 |
-
Then type coding requests interactively.
|
| 75 |
-
|
| 76 |
-
## Dataset Format
|
| 77 |
-
|
| 78 |
-
Training examples use JSONL:
|
| 79 |
-
|
| 80 |
-
```json
|
| 81 |
-
{"instruction":"Fix this Python bug.","input":"def add(a,b): return a-b","output":"def add(a, b):\n return a + b"}
|
| 82 |
```
|
| 83 |
|
| 84 |
-
|
| 85 |
|
| 86 |
```bash
|
| 87 |
-
|
| 88 |
-
--input data/examples.jsonl \
|
| 89 |
-
--output data/prepared.jsonl
|
| 90 |
```
|
| 91 |
|
| 92 |
-
##
|
| 93 |
|
| 94 |
-
|
|
|
|
| 95 |
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
--config configs/qwen3_coder_30b_lora.yaml
|
| 99 |
```
|
| 100 |
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
## What To Fine-Tune On
|
| 104 |
|
| 105 |
-
|
| 106 |
|
| 107 |
-
|
| 108 |
-
- failing test -> fix examples
|
| 109 |
-
- compiler/type error -> corrected code
|
| 110 |
-
- code review comment -> improved diff
|
| 111 |
-
- refactoring requests
|
| 112 |
-
- multi-language explanations plus executable solutions
|
| 113 |
-
- repo-specific style examples
|
| 114 |
|
| 115 |
-
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: Qwen/Qwen2.5-Coder-14B-Instruct
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
tags:
|
| 7 |
+
- code
|
| 8 |
+
- coding-assistant
|
| 9 |
+
- lora
|
| 10 |
+
- fine-tuned
|
| 11 |
+
- gguf
|
| 12 |
+
- ollama
|
| 13 |
+
pipeline_tag: text-generation
|
| 14 |
+
---
|
| 15 |
|
| 16 |
+
# Alpha-Coder-14B
|
| 17 |
|
| 18 |
+
Alpha-Coder-14B is a fine-tuned version of [Qwen2.5-Coder-14B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-14B-Instruct), adapted via LoRA to produce typed, tested Python code. This repo contains both the fused fp16 weights and a Q4_K_M GGUF quant for local inference (e.g. with Ollama or llama.cpp).
|
| 19 |
|
| 20 |
+
## Base model attribution
|
| 21 |
|
| 22 |
+
This model is a derivative of **Qwen/Qwen2.5-Coder-14B-Instruct**, released by the Qwen team under the **Apache 2.0 license**. Alpha-Coder-14B is redistributed under the same license, as permitted by Apache 2.0 for derivative/renamed works, with attribution to the original model and authors.
|
|
|
|
|
|
|
| 23 |
|
| 24 |
+
- Base model: [Qwen/Qwen2.5-Coder-14B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-14B-Instruct)
|
| 25 |
+
- License: Apache 2.0
|
| 26 |
|
| 27 |
+
## Training details
|
| 28 |
|
| 29 |
+
- **Method:** LoRA fine-tuning
|
| 30 |
+
- **Hardware:** Apple Silicon M5, 24GB unified memory
|
| 31 |
+
- **Framework:** MLX (4-bit base model during training)
|
| 32 |
+
- **LoRA config:** rank = 64, alpha = 128, learning rate = 2e-6
|
| 33 |
+
- **Steps:** 6,160
|
| 34 |
+
- **Validation loss:** 0.383 → 0.252
|
| 35 |
+
- **Post-training:** LoRA adapter fused into the base model, dequantized to fp16 HF safetensors, then converted and quantized to GGUF (Q4_K_M, 8.4GB) via llama.cpp
|
| 36 |
|
| 37 |
+
## Benchmarks
|
| 38 |
|
| 39 |
+
| Benchmark | Base (Qwen2.5-Coder-14B-Instruct) | Alpha-Coder-14B |
|
| 40 |
+
|---|---|---|
|
| 41 |
+
| MMLU | 72% | 77% |
|
| 42 |
+
| GSM8K | ~93% (no regression) | 93% |
|
| 43 |
|
| 44 |
+
No measurable forgetting was observed on GSM8K after fine-tuning, while MMLU improved by 5 points.
|
| 45 |
|
| 46 |
+
## Files in this repo
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
|
| 48 |
+
| File | Description |
|
| 49 |
+
|---|---|
|
| 50 |
+
| `*.safetensors` | Fused fp16 weights (LoRA merged into base), full precision |
|
| 51 |
+
| `tokenizer*` / `*.json` | Tokenizer and config files |
|
| 52 |
+
| `alpha-14b-Q4_K_M.gguf` | Q4_K_M quantized GGUF, ~8.4GB, for llama.cpp / Ollama |
|
| 53 |
|
| 54 |
+
## Usage with Ollama
|
|
|
|
|
|
|
| 55 |
|
| 56 |
+
1. Download `alpha-14b-Q4_K_M.gguf` from this repo.
|
| 57 |
+
2. Create a `Modelfile` in the same directory (use your actual system prompt from your local Modelfile).
|
| 58 |
+
3. Build and run:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
```bash
|
| 61 |
+
ollama create alpha-coder -f Modelfile
|
| 62 |
+
ollama run alpha-coder
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
```
|
| 64 |
|
| 65 |
+
## Usage with llama.cpp
|
| 66 |
|
| 67 |
```bash
|
| 68 |
+
./llama-cli -m alpha-14b-Q4_K_M.gguf -p "Write a Python function that ..."
|
|
|
|
|
|
|
| 69 |
```
|
| 70 |
|
| 71 |
+
## Usage with transformers (fp16 safetensors)
|
| 72 |
|
| 73 |
+
```python
|
| 74 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 75 |
|
| 76 |
+
model = AutoModelForCausalLM.from_pretrained("Jay2003Bhatt/alpha-coder-14b", torch_dtype="auto", device_map="auto")
|
| 77 |
+
tokenizer = AutoTokenizer.from_pretrained("Jay2003Bhatt/alpha-coder-14b")
|
|
|
|
| 78 |
```
|
| 79 |
|
| 80 |
+
## Intended use
|
|
|
|
|
|
|
| 81 |
|
| 82 |
+
Alpha-Coder-14B is intended as a coding assistant producing typed, tested Python code. As with any fine-tuned model, evaluate outputs before relying on them in production, particularly for correctness and security-sensitive code.
|
| 83 |
|
| 84 |
+
## License
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
|
| 86 |
+
Apache 2.0, inherited from the base model. See the [Qwen2.5-Coder-14B-Instruct license](https://huggingface.co/Qwen/Qwen2.5-Coder-14B-Instruct/blob/main/LICENSE) for details.
|