Skip to content

About

Blog companion: accelerate local inference with speculative decoding on a Jozu Rapid Inference Container.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Speculative Decoding on Jozu RIC: Speed up local inference with a draft model on a Jozu Rapid Inference Container

Speculative Decoding on Jozu RIC

Speed up local inference with a draft model on a Jozu Rapid Inference Container

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.


Built by Studio1 Built with Jozu

Jozu docs  ·  Jozu  ·  KitOps  ·  More examples  ·  studio1hq.com


Overview

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.

Features

  • Two models, one ModelKit: The target GGUF is the Kitfile model and the draft GGUF is listed under parts.
  • Speculative decoding: llama-server runs with -md (draft model) and --draft-n 4.
  • Baseline run: The same container command without the draft flags.
  • Speed test: A curl loop against /completion generates 2048 tokens three times and prints the timings field.
  • Custom entrypoint: The RIC is started with --entrypoint /app/llama-server so you control the flags.

Tech stack

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

Getting started

Prerequisites

  • 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 all Docker command

Installation

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_hub

Environment variables

No 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.

Run

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

How it works

  1. Download both models into ./Qwen3-family/ with hf_hub_download.
  2. Build the Kitfile (package.name speculative-decoding-with-jozu) and push to jozu.ml/email-prefix-here/speculative-decoding-with-jozu:latest.
  3. 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
  4. Run the baseline by dropping -md and --draft-n 4.
  5. 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

Resources



Studio1

Built by Studio1, the technical content and DevRel partner for devtool teams. Made with Jozu.
Browse more open-source examples at github.com/Studio1HQ.

Website Book a call X LinkedIn

studio1hq.com · Technical content, docs, video and DevRel for devtools

About

Blog companion: accelerate local inference with speculative decoding on a Jozu Rapid Inference Container.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages