A notebook that packages a Qwen3-30B target model and a Qwen3-0.6B draft model in one ModelKit, serves them with a Jozu RIC and compares speed with and without speculative decoding.
Jozu docs · Jozu · KitOps · More examples · studio1hq.com
This repo accompanies the blog post "Accelerate Local AI Inference with speculative decoding on Jozu RIC". The notebook (main.ipynb) contains the commands from the article.
You download a quantized Qwen3-30B-A3B target model and a small Qwen3-0.6B draft model, package both in one KitOps ModelKit (the draft is a parts entry on the model), push it to Jozu Hub and run it with a Jozu Rapid Inference Container (RIC). You run llama-server with and without a draft model and time the generation.
- Two models, one ModelKit: The target GGUF is the Kitfile
modeland the draft GGUF is listed underparts. - Speculative decoding:
llama-serverruns with-md(draft model) and--draft-n 4. - Baseline run: The same container command without the draft flags.
- Speed test: A
curlloop against/completiongenerates 2048 tokens three times and prints thetimingsfield. - Custom entrypoint: The RIC is started with
--entrypoint /app/llama-serverso you control the flags.
| Layer | Tool |
|---|---|
| Target model | Qwen3-30B-A3B-Instruct-2507 GGUF (UD-TQ1_0) |
| Draft model | Qwen3-0.6B GGUF (Q8_0) |
| Packaging | KitOps CLI and kitops Python library |
| Registry and runtime | Jozu Hub and Jozu Rapid Inference Container (llama.cpp) |
| Runtime | Python 3.11+, Docker, Jupyter |
- Python 3.11 or later and Jupyter
- Docker
- A Jozu Hub account at jozu.ml
- Homebrew on Linux or macOS (the notebook installs it if missing)
- A machine with an NVIDIA GPU and the NVIDIA container toolkit for the
--gpus allDocker command
git clone https://github.com/Studio1HQ/speculative_decoding_with_jozu.git
cd speculative_decoding_with_jozu
brew tap kitops-ml/kitops
brew install kitops
pip install kitops huggingface_hubNo environment variables. The notebook authenticates with the email and password of your Jozu Hub account and uses placeholders you replace.
| Placeholder | Description |
|---|---|
email-prefix-here |
The part of your Jozu Hub email before the @ (for jack123@gmail.com use jack123). Keep tags lowercase. |
full-email-here, password-here |
Jozu Hub credentials passed to UserCredentials in the notebook. |
Log in to Jozu Hub in a terminal (you are prompted for email and password), then open the notebook:
kit login jozu.ml
jupyter notebook main.ipynb- Download both models into
./Qwen3-family/withhf_hub_download. - Build the Kitfile (
package.namespeculative-decoding-with-jozu) and push tojozu.ml/email-prefix-here/speculative-decoding-with-jozu:latest. - Run with speculative decoding:
sudo docker run -it --rm -p 8000:8000 --gpus all \ --entrypoint /app/llama-server \ "jozu.ml/email-prefix-here/speculative-decoding-with-jozu/llama-cpp-cuda:latest" \ -m /Qwen3-family/Qwen3-30B-A3B-Instruct-2507-UD-TQ1_0.gguf \ -md /Qwen3-family/Qwen3-0.6B-Q8_0.gguf \ --jinja --chat-template-kwargs '{"enable_thinking": false}' \ --host 0.0.0.0 --port 8000 -c 40965 --draft-n 4
- Run the baseline by dropping
-mdand--draft-n 4. - Time each setup:
for i in 1 2 3; do curl -s http://localhost:8000/completion -d '{"prompt": "Write an elaborate step by step technical guide on how to pre-train, finetune, and inference large language models.", "n_predict": 2048, "temperature": 0}' \ | python3 -c "import json,sys; print(json.dumps(json.load(sys.stdin)['timings'], indent=2))" done
-
Jozu documentation: Jozu Hub and Rapid Inference Container guides.
-
Jozu: Product site.
-
KitOps documentation: ModelKit and Kitfile reference.
-
llama.cpp: The server used inside the RIC.
Built by Studio1, the technical content and DevRel partner for devtool teams. Made with Jozu.
Browse more open-source examples at github.com/Studio1HQ.
studio1hq.com · Technical content, docs, video and DevRel for devtools