Instructions to use clglavan/magos-k8s-0.6b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use clglavan/magos-k8s-0.6b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="clglavan/magos-k8s-0.6b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("clglavan/magos-k8s-0.6b") model = AutoModelForCausalLM.from_pretrained("clglavan/magos-k8s-0.6b") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - llama-cpp-python
How to use clglavan/magos-k8s-0.6b with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="clglavan/magos-k8s-0.6b", filename="magos-k8s-0.6b-f16.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use clglavan/magos-k8s-0.6b with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf clglavan/magos-k8s-0.6b:Q4_K_M # Run inference directly in the terminal: llama-cli -hf clglavan/magos-k8s-0.6b:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf clglavan/magos-k8s-0.6b:Q4_K_M # Run inference directly in the terminal: llama-cli -hf clglavan/magos-k8s-0.6b: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 clglavan/magos-k8s-0.6b:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf clglavan/magos-k8s-0.6b: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 clglavan/magos-k8s-0.6b:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf clglavan/magos-k8s-0.6b:Q4_K_M
Use Docker
docker model run hf.co/clglavan/magos-k8s-0.6b:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use clglavan/magos-k8s-0.6b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "clglavan/magos-k8s-0.6b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "clglavan/magos-k8s-0.6b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/clglavan/magos-k8s-0.6b:Q4_K_M
- SGLang
How to use clglavan/magos-k8s-0.6b with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "clglavan/magos-k8s-0.6b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "clglavan/magos-k8s-0.6b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "clglavan/magos-k8s-0.6b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "clglavan/magos-k8s-0.6b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use clglavan/magos-k8s-0.6b with Ollama:
ollama run hf.co/clglavan/magos-k8s-0.6b:Q4_K_M
- Unsloth Studio
How to use clglavan/magos-k8s-0.6b 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 clglavan/magos-k8s-0.6b 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 clglavan/magos-k8s-0.6b to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for clglavan/magos-k8s-0.6b to start chatting
- Pi
How to use clglavan/magos-k8s-0.6b with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf clglavan/magos-k8s-0.6b: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": "clglavan/magos-k8s-0.6b:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use clglavan/magos-k8s-0.6b with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf clglavan/magos-k8s-0.6b: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 clglavan/magos-k8s-0.6b:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use clglavan/magos-k8s-0.6b with Docker Model Runner:
docker model run hf.co/clglavan/magos-k8s-0.6b:Q4_K_M
- Lemonade
How to use clglavan/magos-k8s-0.6b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull clglavan/magos-k8s-0.6b:Q4_K_M
Run and chat with the model
lemonade run user.magos-k8s-0.6b-Q4_K_M
List all available models
lemonade list
magos-k8s-0.6b
magos-k8s-0.6b is a 0.6B-parameter reasoning model for Kubernetes
diagnostics, derived from Qwen3-0.6B. It is trained in two full-weight
stages: continued pre-training (CPT) on Kubernetes documentation, the v1.34 API
reference (every resource Kind), the kubectl command reference, and Prometheus
alert runbooks; followed by supervised fine-tuning (SFT) on event→YAML
diagnostic pairs. Each response is a structured <think> reasoning trace
followed by a concise answer — a kubectl/promtool command, a YAML patch, or
a root cause plus fix.
Scope and design
The model targets a narrow task: mapping a Kubernetes symptom (a failed or
Warning condition, a kubectl describe/events excerpt, a misconfigured
manifest) to the responsible spec field and the corrective action. The reasoning
trace is intentionally short and templated (implicated condition → spec
field → verdict → fix / next command) rather than open-ended chain-of-thought —
that is the form a 0.6B model reproduces reliably without drifting into
invented detail.
Because every response terminates in a concrete next action, the model fits as
the inner-loop reasoner of a planner→executor devops agent. It is full-weight
fine-tuned (no LoRA/adapters), ships as bf16 safetensors plus GGUF
quantizations, and runs locally at ~640 MB (Q8). Knowledge is frozen at the
training-snapshot; treat it as a reasoning component, not a source of truth, and
verify field/flag specifics against current docs or live kubectl explain.
What's new in v15 (vs v8)
v15 is a ground-up redesign of the Stage-2 training data around event-grounded diagnostic reasoning. Every training example is a matched pair:
- a BROKEN case — failed/Warning events ↔ the exact offending YAML field, and
- a HEALTHY case — clean events ↔ the same field set correctly,
so the model learns both to detect a fault from the evidence and to confirm health, across ~80 failure subcategories (scheduling, image, crashloop, probes, volumes, networking, RBAC/PodSecurity, controllers, quota/limits, and more). The reasoning is a short, structured chain (events → correlate to field → verdict → fix), which is the form small models can actually reproduce.
| v8 | v15 | |
|---|---|---|
| Output style | terse, command-first (no <think>) |
structured <think> reasoning (events → field → verdict → fix) |
| Stage-2 data | mixed reference + contrast + general | ~16.6k event→YAML diagnostic matched pairs |
| Stage-2 recipe | 2 epochs, LR 1.5e-5, batch 16 | 4 epochs, LR 2e-5, batch 32 |
Benchmark (LLM-judged, 3× self-consistency, anonymized A/B, 44 prompts)
Each prompt is graded by 3 independent judges who see the responses anonymized, must list verified facts and hallucinations, and rate strictly for agent-usability (one wrong flag/field = not usable) before scoring 1–5. Per-prompt score is the median of the 3 judges.
| Bucket | Max | v8 | v15 | Δ |
|---|---|---|---|---|
| kubectl/CLI | 30 | 18 | 6 | −12 |
| YAML | 25 | 12 | 21 | +9 |
| Diagnose | 75 | 26 | 29 | +3 |
| Runbook | 75 | 23 | 26 | +3 |
| General | 15 | 13 | 14 | +1 |
| Total | 220 | 92 (41%) | 96 (43%) | +4 |
- Hallucinations: v15 = 285 vs v8 = 330 (−14%).
- Agent-usable rate: v15 = 31% vs v8 = 21%.
Headline: v15 beats v8 overall and on 4 of 5 buckets, while reducing hallucinations and raising the agent-usable rate. The event→field grounding pays off most on YAML (+9) and diagnosis.
Known regression: v15 loses hard on kubectl/CLI (−12) — its training is
purely diagnostic, so it tends to over-diagnose a plain command request ("tail
these logs", "drain this node") instead of just emitting the one-liner. If you
need crisp single commands, pin revision="v8"; for diagnosis/triage/YAML, use
v15.
To pin a specific version when loading:
AutoModelForCausalLM.from_pretrained("clglavan/magos-k8s-0.6b", revision="v15")
# or revision="v8" / "v7" / "v6" / "v5" / "v3" / "v2" for previous versions
What it's good at
- Diagnosing from events — paste
kubectl get events/kubectl describeoutput and it correlates the failure to the responsible YAML field + fix. - YAML manifest generation and review — strongest bucket in v15; correct apiVersion/field names across Pod, Deployment, Service, NetworkPolicy, PVC, HPA, Ingress, RBAC and many other Kinds.
- Prometheus alert handling — meaning + diagnostic steps for the prometheus-operator runbook set.
- Structured next-step reasoning — short
<think>that ends in a concrete command or fix, suitable as an agent's inner-loop reasoner.
What it's not good at
- Plain single kubectl commands — see the v15 regression above; use
revision="v8"if that's your main use case. - Multi-step planning or complex tool chains — it's a 0.6B model.
- Subtle/rare flags and multi-flag combinations — verify with
kubectl --help. - Knowledge of features released after the source docs were captured (mid-2026).
How to use
Important — sampling: v15 is a reasoning model. Run it greedy with
repetition_penalty = 1.0. A repetition penalty > 1.0 penalizes the prompt words the<think>block needs to reference and collapses it to an empty<think></think>. (This differs from the terse v8, which used temp 0.05 / rep 1.15.)
llama.cpp / Ollama / LM Studio
| File | Size | Quality |
|---|---|---|
magos-k8s-0.6b-f16.gguf |
~1.2 GB | reference (full precision) |
magos-k8s-0.6b-q8_0.gguf |
~640 MB | effectively identical to f16 — recommended |
magos-k8s-0.6b-q4_k_m.gguf |
~400 MB | smallest; more field/flag mistakes — fine for casual use |
from llama_cpp import Llama
llm = Llama(model_path="magos-k8s-0.6b-q8_0.gguf", n_ctx=4096, chat_format="chatml")
resp = llm.create_chat_completion(
messages=[{"role": "user", "content":
"kubectl describe pod shows: Warning FailedScheduling 0/3 nodes are available: 3 Insufficient memory. Why?"}],
temperature=0.0,
repeat_penalty=1.0,
max_tokens=512,
)
print(resp["choices"][0]["message"]["content"])
Hugging Face transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("clglavan/magos-k8s-0.6b")
model = AutoModelForCausalLM.from_pretrained("clglavan/magos-k8s-0.6b",
dtype="bfloat16",
device_map="auto")
messages = [{"role": "user", "content":
"My pod is CrashLoopBackOff right after deploy. What's the likely cause and fix?"}]
prompt = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tok(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=512,
do_sample=False, repetition_penalty=1.0)
print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Training
| Base model | Qwen/Qwen3-0.6B |
| Method | Two stage: continued pre-training (CPT) → supervised fine-tuning (SFT). Both full-weight (no LoRA). |
| Stage 1 corpus | |
| Stage 1 | LR 5e-6, cosine, 1 epoch (~6.5M tokens) |
| Stage 2 corpus (v15) | ~16.6k synthetic Q&A pairs derived from the official documentation — event→YAML diagnostic matched BROKEN/HEALTHY pairs across ~80 K8s failure subcategories, nearly all with a structured <think> reasoning block. |
| Stage 2 | LR 2e-5, cosine, 4 epochs, micro-batch 1 / grad-accum 32 (effective batch 32), seq len 2048, bf16 |
Files
model.safetensors— fine-tuned weights, HF format (bf16)magos-k8s-0.6b-f16.gguf/-q8_0.gguf/-q4_k_m.gguf— GGUF quantizationstokenizer.json,tokenizer_config.json,chat_template.jinja— Qwen3 tokenizer + ChatML templateconfig.json,generation_config.json— standard HF configs
Limitations and intended use
This is a small experimental model. Always verify any command, YAML, or behavioral claim against current Kubernetes documentation before running in production. Intended for learning, prototyping, and as a component in local devops agents — not as an authoritative source.
License
Apache 2.0. Inherits from the Qwen3-0.6B base model license. The training data is derived from the official Kubernetes documentation (CC-BY 4.0) and the prometheus-operator Prometheus runbooks (Apache 2.0).
- Downloads last month
- 1,372