Instructions to use dcostenco/prism-coder-1.7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use dcostenco/prism-coder-1.7b with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="dcostenco/prism-coder-1.7b", filename="prism-aac-1b7-q4km.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use dcostenco/prism-coder-1.7b with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf dcostenco/prism-coder-1.7b:Q8_0 # Run inference directly in the terminal: llama-cli -hf dcostenco/prism-coder-1.7b:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf dcostenco/prism-coder-1.7b:Q8_0 # Run inference directly in the terminal: llama-cli -hf dcostenco/prism-coder-1.7b:Q8_0
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 dcostenco/prism-coder-1.7b:Q8_0 # Run inference directly in the terminal: ./llama-cli -hf dcostenco/prism-coder-1.7b:Q8_0
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 dcostenco/prism-coder-1.7b:Q8_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf dcostenco/prism-coder-1.7b:Q8_0
Use Docker
docker model run hf.co/dcostenco/prism-coder-1.7b:Q8_0
- LM Studio
- Jan
- Ollama
How to use dcostenco/prism-coder-1.7b with Ollama:
ollama run hf.co/dcostenco/prism-coder-1.7b:Q8_0
- Unsloth Studio
How to use dcostenco/prism-coder-1.7b 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 dcostenco/prism-coder-1.7b 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 dcostenco/prism-coder-1.7b to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for dcostenco/prism-coder-1.7b to start chatting
- Pi
How to use dcostenco/prism-coder-1.7b with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf dcostenco/prism-coder-1.7b:Q8_0
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": "dcostenco/prism-coder-1.7b:Q8_0" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use dcostenco/prism-coder-1.7b with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf dcostenco/prism-coder-1.7b:Q8_0
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 dcostenco/prism-coder-1.7b:Q8_0
Run Hermes
hermes
- Docker Model Runner
How to use dcostenco/prism-coder-1.7b with Docker Model Runner:
docker model run hf.co/dcostenco/prism-coder-1.7b:Q8_0
- Lemonade
How to use dcostenco/prism-coder-1.7b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull dcostenco/prism-coder-1.7b:Q8_0
Run and chat with the model
lemonade run user.prism-coder-1.7b-Q8_0
List all available models
lemonade list
docs: updated benchmark scores — v26 system prompt + nothink template (May 14 2026)
Browse files
README.md
CHANGED
|
@@ -19,57 +19,51 @@ On-device MCP tool router based on **Qwen/Qwen3-1.7B**. Runs in 1.6 GB RAM at Q4
|
|
| 19 |
|
| 20 |
## Test results — Prism routing 100-case eval (May 14 2026)
|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
| Category |
|
| 25 |
-
|---|---|
|
| 26 |
-
| **Overall** | **84.0%
|
| 27 |
-
| session_load_context | 100% |
|
| 28 |
-
| session_save_ledger | 76% |
|
| 29 |
-
| session_search_memory | 78% |
|
| 30 |
-
| session_save_handoff | 74% |
|
| 31 |
-
| session_compact_ledger | 100% |
|
| 32 |
-
| brave_web_search | 100% |
|
| 33 |
-
| knowledge_search | 71% |
|
| 34 |
-
| AAC plain-text | 91% |
|
| 35 |
-
| translate plain-text | 100% |
|
| 36 |
-
|
|
| 37 |
-
|
|
| 38 |
-
| info / lookup | 60% |
|
| 39 |
-
| edge (multi-step) | 65% |
|
| 40 |
-
| **avg latency** | 1.
|
| 41 |
-
| **invented tools** |
|
| 42 |
-
|
| 43 |
-
**
|
| 44 |
-
|
| 45 |
-
**
|
|
|
|
|
|
|
| 46 |
|
| 47 |
**Where this model wins**:
|
| 48 |
-
- **Fits on an iPhone** (1.6 GB Q4_K_M runtime
|
| 49 |
-
- **Fastest** of any Prism Coder model — 1.6 s average
|
| 50 |
-
- **100% on
|
|
|
|
| 51 |
- Zero cloud, zero per-token cost, fully offline
|
| 52 |
|
| 53 |
-
**Where it underperforms** (vs 14B at 90% / 32B at 93.7% / Claude Sonnet at 99%):
|
| 54 |
-
- `info` — 60%. Small models struggle to distinguish "what does X mean" (lookup) from "what is X" (static fact).
|
| 55 |
-
- `edge` — 65%. Multi-step routing decisions are too long-tailed for a 1.7B model.
|
| 56 |
-
- `save` / `smem` / `hand` / `know` — all in the 70s. The exact session-memory tool boundary is subtle at this size.
|
| 57 |
-
- **May at capacity ceiling** — a v25-max retrain attempt regressed gate scores. Small models have inherent precision limits for routing taxonomies this granular.
|
| 58 |
-
|
| 59 |
-
For production: this model is the "free tier" fallback. Pair with cloud Claude for accuracy-critical paths. The [Synalux router](https://github.com/dcostenco/prism-coder) handles the cascade automatically.
|
| 60 |
-
|
| 61 |
## Use case: iOS deployment
|
| 62 |
|
| 63 |
This is the model the [Prism AAC](https://github.com/dcostenco/prism-aac) iOS / iPadOS / watchOS apps load on-device via **llama.cpp Swift SPM**. CoreML was evaluated and rejected — `coremltools` doesn't support Qwen3 attention ops.
|
| 64 |
|
| 65 |
-
GGUF available: `prism-aac-1b7-q4km.gguf` (1.0 GB on disk, ~1.6 GB RAM at runtime).
|
| 66 |
|
| 67 |
## Training recipe (v19)
|
| 68 |
|
| 69 |
-
- **Base**: Qwen/Qwen3-1.7B +
|
| 70 |
-
- **Note**:
|
| 71 |
-
- **Quantization**: Q4_K_M (1.0 GB) for iOS, Q8 (2.2 GB) for Mac
|
| 72 |
-
- **Hardware**: Mac M4 Max (MLX-LM) for the prompt-engineering eval cycle
|
| 73 |
|
| 74 |
## Usage
|
| 75 |
|
|
@@ -80,26 +74,13 @@ ollama pull dcostenco/prism-coder:1b7
|
|
| 80 |
ollama run dcostenco/prism-coder:1b7 "Search my knowledge for OAuth scope reference"
|
| 81 |
```
|
| 82 |
|
| 83 |
-
### iOS — llama.cpp Swift SPM
|
| 84 |
-
|
| 85 |
-
See [prism-aac/ios-native](https://github.com/dcostenco/prism-aac/tree/main/ios-native) for the full integration: `LLMEngine.swift` → `prismNativeBridge.askAI()` → `window.prismNativeAIResult()` token stream.
|
| 86 |
-
|
| 87 |
-
### HuggingFace (transformers)
|
| 88 |
-
|
| 89 |
-
```python
|
| 90 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 91 |
-
model = AutoModelForCausalLM.from_pretrained("dcostenco/prism-coder-1.7b", torch_dtype="auto")
|
| 92 |
-
tok = AutoTokenizer.from_pretrained("dcostenco/prism-coder-1.7b")
|
| 93 |
-
```
|
| 94 |
-
|
| 95 |
### System prompt
|
| 96 |
|
| 97 |
-
Use the [
|
| 98 |
|
| 99 |
## Hardware requirements
|
| 100 |
|
| 101 |
- **iPhone / iPad**: A14 Bionic+ (iPhone 12+), iOS 15+, ~1.6 GB free RAM
|
| 102 |
-
- **Apple Watch (standalone)**: Series 10+ for on-device, otherwise paired-mode via iPhone
|
| 103 |
- **Mac**: any M-series (M1 8 GB unified is enough at Q4_K_M)
|
| 104 |
- **Linux**: any CPU works at Q4_K_M; a 4 GB GPU dramatically speeds inference
|
| 105 |
- **Inference speed**: ~0.5–1.6 s per 200-token response
|
|
|
|
| 19 |
|
| 20 |
## Test results — Prism routing 100-case eval (May 14 2026)
|
| 21 |
|
| 22 |
+
100 prompts (seed=2027), v26 system prompt.
|
| 23 |
+
|
| 24 |
+
| Category | Current | Previous (v19 old prompt) | Δ |
|
| 25 |
+
|---|---|---|---|
|
| 26 |
+
| **Overall** | **88%** | 84.0% | **+4.0** |
|
| 27 |
+
| session_load_context | 100% | 100% | = |
|
| 28 |
+
| session_save_ledger | 85% | 76% | +9 |
|
| 29 |
+
| session_search_memory | 100% | 78% | +22 |
|
| 30 |
+
| session_save_handoff | 75% | 74% | +1 |
|
| 31 |
+
| session_compact_ledger | 100% | 100% | = |
|
| 32 |
+
| brave_web_search | 86% | 100% | -14 |
|
| 33 |
+
| knowledge_search | 43% | 71% | -28 |
|
| 34 |
+
| AAC plain-text | **100%** | 91% | **+9** |
|
| 35 |
+
| translate plain-text | 100% | 100% | = |
|
| 36 |
+
| plain text (pred/irrel) | 100% | 88% | +12 |
|
| 37 |
+
| no-tool refusal | 83% | 83% | = |
|
| 38 |
+
| info / lookup | 100% | 60% | +40 |
|
| 39 |
+
| edge (multi-step) | 60% | 65% | -5 |
|
| 40 |
+
| **avg latency** | **1.6s** | 1.6s | = |
|
| 41 |
+
| **invented tools** | **0** | 2 | **-2** |
|
| 42 |
+
|
| 43 |
+
**Key improvements**: AAC routing 91% → 100% (life-critical fix), zero invented tool names (was 2), info/lookup 60% → 100%, session_search_memory 78% → 100%.
|
| 44 |
+
|
| 45 |
+
**Below the 90% gate** — this model is published for the **on-device / cost-sensitive** use case, not for accuracy-critical work. The bottleneck is `knowledge_search` at 43% (same as 14B).
|
| 46 |
+
|
| 47 |
+
**What this benchmark measures**: routing precision against the *exact* 7-tool Prism Coder taxonomy. **Not** a general-capability score. Methodology + runner: [github.com/dcostenco/prism-coder/tree/main/tests/benchmarks/prism-routing-100](https://github.com/dcostenco/prism-coder/tree/main/tests/benchmarks/prism-routing-100).
|
| 48 |
|
| 49 |
**Where this model wins**:
|
| 50 |
+
- **Fits on an iPhone** (1.6 GB Q4_K_M runtime)
|
| 51 |
+
- **Fastest** of any Prism Coder model — 1.6 s average
|
| 52 |
+
- **100% on 6 categories**: load_ctx, srch_mem, compact, translate, AAC, plain_text
|
| 53 |
+
- Zero invented tool names (improved from 2 in previous version)
|
| 54 |
- Zero cloud, zero per-token cost, fully offline
|
| 55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
## Use case: iOS deployment
|
| 57 |
|
| 58 |
This is the model the [Prism AAC](https://github.com/dcostenco/prism-aac) iOS / iPadOS / watchOS apps load on-device via **llama.cpp Swift SPM**. CoreML was evaluated and rejected — `coremltools` doesn't support Qwen3 attention ops.
|
| 59 |
|
| 60 |
+
GGUF available: `prism-aac-1b7-q4km.gguf` (1.0 GB on disk, ~1.6 GB RAM at runtime).
|
| 61 |
|
| 62 |
## Training recipe (v19)
|
| 63 |
|
| 64 |
+
- **Base**: Qwen/Qwen3-1.7B + v26 system-prompt engineering
|
| 65 |
+
- **Note**: Uses **system-prompt engineering only** (no LoRA fine-tune). Small models over-fit aggressively — a v25-max LoRA attempt regressed 100% → 93.8% on a 16-case gate test.
|
| 66 |
+
- **Quantization**: Q4_K_M (1.0 GB) for iOS, Q8 (2.2 GB) for Mac
|
|
|
|
| 67 |
|
| 68 |
## Usage
|
| 69 |
|
|
|
|
| 74 |
ollama run dcostenco/prism-coder:1b7 "Search my knowledge for OAuth scope reference"
|
| 75 |
```
|
| 76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
### System prompt
|
| 78 |
|
| 79 |
+
Use the [v26 routing prompt](https://github.com/dcostenco/prism-coder/blob/main/tests/benchmarks/prism-routing-100/benchmark.py#L47) verbatim. This model relies *heavily* on the system prompt. Key: rules 1-7 must say `-> respond directly (no tool)`.
|
| 80 |
|
| 81 |
## Hardware requirements
|
| 82 |
|
| 83 |
- **iPhone / iPad**: A14 Bionic+ (iPhone 12+), iOS 15+, ~1.6 GB free RAM
|
|
|
|
| 84 |
- **Mac**: any M-series (M1 8 GB unified is enough at Q4_K_M)
|
| 85 |
- **Linux**: any CPU works at Q4_K_M; a 4 GB GPU dramatically speeds inference
|
| 86 |
- **Inference speed**: ~0.5–1.6 s per 200-token response
|