Built for kubehealth. magos is a 0.6B
Kubernetes troubleshooting model fine-tuned from Qwen3-0.6B, designed to be the
local model behind kubehealth, a read-only Kubernetes triage tool. kubehealth
collects and compresses the evidence (events, describe, warnings on owned objects,
container logs); magos reads it, investigates with kubehealth's four read-only tools
when the cause sits elsewhere, and answers in plain text: what is wrong, the
evidence, the fix, how sure. Runs locally (~640 MB at Q8). Other harnesses can use it
too: the exact tools it was trained on are listed below.
Current: v20 — inside kubehealth with link-following on (its default) it finds the right root cause 91% of the time (base model 79%) and the right fix 88%, finds a cause hidden in another object 78% of the time, and no longer invents faults on healthy objects (88%, up from 71% in v19).
magos is a small model, so it needs a strong harness. kubehealth does what a 0.6B model can't do on its own:
get_pod_logs,
get_object_describe, get_object_events, get_correlated_events) and stops it
before the context runs outkubehealth-embed bundles this model and runs it offline. With the regular build,
serve the GGUF through LM Studio or any OpenAI-compatible server and set
LMSTUDIO_MODEL. On its own, with long unstructured prompts or open-ended
multi-step planning, a 0.6B model loses track quickly.
magos was trained to call exactly these four read-only tools, with these names,
descriptions and parameters, in Qwen3's native function-calling format
(<tool_call>{"name": …, "arguments": {…}}</tool_call>, which llama.cpp,
LM Studio and vLLM expose through the OpenAI-compatible tools API). Offer the same
definitions and return results in the same shape, and a harness of your own gets the
behaviour measured below. It typically makes 0–3 calls per investigation; cap the
loop (kubehealth allows 5 rounds).
| Tool | Arguments | What the training data returned |
|---|---|---|
get_pod_logs |
namespace, pod_name |
Pod logs for <ns>/<pod> (last 150 lines): then an optional Container state: <c> restarted N times, last run ended <Reason> (exit code X), now <Waiting>. line and the log lines ([previous container run] for crash loops). Missing: no logs available for pod <ns>/<pod> |
get_object_describe |
namespace (empty for cluster-scoped), kind, name |
Describe <ns>/<Kind>/<name>: then Age:, Labels:, Annotations:, per-kind sections ( Key: value rows: replicas, pod template, probes, env refs, volumes, selector/endpoints, PVC/PV/Node/HPA/Ingress fields) and Conditions:. Missing: <ns>/<Kind>/<name> no longer exists in the cluster |
get_object_events |
namespace, kind, name |
Events for <ns>/<Kind>/<name> (N total): then - [Warning] Reason: message (×count, 3m ago) lines. None: no cached events for <ns>/<Kind>/<name> |
get_correlated_events |
namespace, kind, name (the anchor) |
Correlated events (±5 min, N events across namespaces): grouped by [namespace], lines - [Warning] Kind/name Reason: message (×count, age ago), in a window around the anchor's own events. None: no correlated events found in the time window |
tools JSON, verbatim from training)[
{
"type": "function",
"function": {
"name": "get_pod_logs",
"description": "Fetch the last N lines of logs from a pod's containers. Use when a pod is crashing, restarting, or shows OOMKilled.",
"parameters": {
"type": "object",
"properties": {
"namespace": {
"type": "string",
"description": "Kubernetes namespace"
},
"pod_name": {
"type": "string",
"description": "Pod name"
}
},
"required": [
"namespace",
"pod_name"
]
}
}
},
{
"type": "function",
"function": {
"name": "get_object_describe",
"description": "Get spec, status, and conditions of any Kubernetes object. Use to check resource limits, image, node, replicas, and current conditions.",
"parameters": {
"type": "object",
"properties": {
"namespace": {
"type": "string",
"description": "Namespace (empty for cluster-scoped resources)"
},
"kind": {
"type": "string",
"description": "Resource kind, e.g. Pod, Deployment, Node, Service"
},
"name": {
"type": "string",
"description": "Resource name"
}
},
"required": [
"namespace",
"kind",
"name"
]
}
}
},
{
"type": "function",
"function": {
"name": "get_object_events",
"description": "Get cached Kubernetes events for a specific object. Use to inspect a correlated object's event history.",
"parameters": {
"type": "object",
"properties": {
"namespace": {
"type": "string",
"description": "Kubernetes namespace"
},
"kind": {
"type": "string",
"description": "Resource kind"
},
"name": {
"type": "string",
"description": "Resource name"
}
},
"required": [
"namespace",
"kind",
"name"
]
}
}
},
{
"type": "function",
"function": {
"name": "get_correlated_events",
"description": "Find events across ALL namespaces in the same time window as the anchor object. Use when suspecting cluster-level issues.",
"parameters": {
"type": "object",
"properties": {
"namespace": {
"type": "string",
"description": "Namespace of the anchor object"
},
"kind": {
"type": "string",
"description": "Kind of the anchor object"
},
"name": {
"type": "string",
"description": "Name of the anchor object"
}
},
"required": [
"namespace",
"kind",
"name"
]
}
}
}
]
Benchmark code, incidents and how to run it: kubehealth → bench/ (README).
54 incidents recorded from real Kubernetes clusters (kind) — 40 faults, 15 of them with the cause in another object than the one that shows the symptom, and 14 healthy objects, some with harmless noise — replayed through kubehealth's own prompts, context budget and tools. Each model runs every incident with 3 seeds; a score is the mean. Scoring reads the diagnosis from the whole answer (keyword checks on the cause and the fix), never its layout. Same llama.cpp server for every model (BF16, 8k context).
| Check | Qwen3-0.6B (base) | magos v16 | magos v17 | magos v18 | magos v19 | magos v20 | reference: Claude Haiku 5.5 | reference: Gemini 3.8 Flash |
|---|---|---|---|---|---|---|---|---|
| RCA: right root cause Asked "why is this broken?", does the final answer name the real cause? |
67% | 64% | 51% | 72% | 88% | 82% | 99% | 89% |
| RCA: names the decisive detail Does it name the exact value that proves it: the wrong image tag, the 48Mi limit, the missing class name? |
56% | 67% | 48% | 52% | 85% | 85% | 89% | 93% |
| RCA: right fix Does it say what to actually do about the real cause (create, change, roll back …)? |
56% | 62% | 48% | 54% | 71% | 71% | 93% | 89% |
| RCA: looks further when the cause is elsewhere When the evidence it was handed isn't enough, does it go and fetch more with a tool? |
0% | 0% | 2% | 0% | 98% | 98% | 0% | 98% |
| RCA: tool calls per incident How many lookups it makes per investigation (kubehealth allows up to 5). |
0.0 | 0.0 | 0.0 | 0.0 | 1.7 | 1.9 | 0.0 | 1.5 |
| RCA: finds the cause in another object The symptom is in one object, the cause in another (the app crashes because its database can't start). Does it name the deeper cause? |
2% | 7% | 4% | 2% | 20% | 18% | 44% | 62% |
| RCA: finishes with an answer Does the investigation end with an answer (not an error, a loop or an empty reply)? |
100% | 98% | 99% | 99% | 98% | 96% | 100% | 92% |
| Analysis: right issue Asked "is anything wrong with this object?", does it name the real problem? |
79% | 68% | 58% | 70% | 91% | 88% | 100% | 97% |
| Analysis: right action Does that answer also say what to do about it? |
64% | 59% | 55% | 58% | 66% | 65% | 88% | 78% |
| Healthy object: no invented fault On objects that are fine, some with harmless noise (a startup blip, a retried job), does it correctly say nothing is wrong? |
86% | 83% | 81% | 57% | 71% | 88% | 95% | 90% |
| Note: points to the right first check The one-line hint on kubehealth's overview: does it point at the real problem? (only 6 notes, so this row is noisy) |
33% | 39% | 39% | 50% | 50% | 50% | 83% | 67% |
Reference columns: Claude Haiku 5.5 and Gemini 3.8 Flash, run on the same 54 incidents through the same kubehealth prompts and tools (their tool calls go through a JSON protocol instead of native function calling). Much larger hosted models, shown for scale. The table above runs without link-following; with it (below), v20 passes Gemini 3.8 Flash on root cause and on causes hidden in another object.
Measured with kubehealth v0.3.0 (plain questions with no required answer format,
richer describe output, a better token budget).
kubehealth's link-following fetches the object the evidence names before asking the model — the PVC a Pending pod waits on and its StorageClass, the Service a crashing app can't reach and the pods behind it, a missing ConfigMap or Secret key — and adds a short block of that evidence to the prompt. Same 54 incidents, 3 seeds:
| Check | Qwen3-0.6B (base) | base + links | magos v19 | magos v19 + links | magos v20 | magos v20 + links |
|---|---|---|---|---|---|---|
| RCA: finds the cause in another object The symptom is in one object, the cause in another. Does it name the deeper cause? |
2% | 49% | 20% | 78% | 18% | 78% |
| RCA: right root cause Does the final answer name the real cause? |
67% | 79% | 88% | 87% | 82% | 91% |
| RCA: right fix Does it say what to actually do about the real cause? |
56% | 75% | 71% | 87% | 71% | 88% |
| Analysis: right action Does the analysis say what to do about the problem? |
64% | 79% | 66% | 88% | 65% | 83% |
| Healthy object: no invented fault On objects that are fine, does it correctly say nothing is wrong? |
86% | 86% | 71% | 71% | 88% | 88% |
The model and the harness add up: link-following alone takes the base model from 2% to 49% on hidden causes; v19 and v20 with link-following reach 78%, and v20 + links has the best root cause (91%) and fix (88%) of any local model so far. The reference columns above ran without link-following.
Known gaps (v20): the healthy-object gap is closed (88%, base 86%). Without link-following its investigation still often stops one hop short (hidden causes ~20%), and it investigates more than v19, so a long investigation can overflow kubehealth's 8k context: 4 of 120 runs ended with no answer, which is most of the drop in root cause without links (82% vs v19's 88%). With link-following on, which is kubehealth's default, this mostly disappears (1 of 120). The analysis's suggested action is a bit weaker with links than v19's (83% vs 88%).
Measured for v16/v17; not yet re-run for v20.
CloudEval-YAML (NeurIPS 2023), Kubernetes subset, 283 English problems, scored against reference YAML. kv_wildcard = share of the reference's keys/values reproduced.
| Model | kv_wildcard | BLEU | edit distance |
|---|---|---|---|
| Qwen3-0.6B (base) | 29.8 | 39.0 | 29.9 |
| magos v16 | 42.9 | 46.6 | 33.4 |
| magos v17 | 40.6 | 43.9 | 32.0 |
| official, full 1,011-problem set: GPT-4 Turbo | 66.7 | 64.9 | 55.1 |
| official, full set: GPT-3.5 | 60.1 | 61.2 | 51.1 |
| official, full set: Llama-2-70b-chat | 27.6 | 35.5 | 30.5 |
Official rows average Kubernetes + Envoy + Istio and translated questions; not strictly comparable with the Kubernetes-only English subset.
Berkeley Function Calling Leaderboard, Qwen3 native function-calling format. simple = one correct call; multiple = pick the right function; irrelevance = correctly not calling when no tool fits.
| Model | simple (python) | multiple | irrelevance |
|---|---|---|---|
| Qwen3-0.6B (base) | 85.8 | 82.5 | 83.3 |
| magos v16 | 81.0 | 79.0 | 60.8 |
| magos v17 | 55.8 | 50.5 | 93.3 |
| official: Gemini 2.5 Flash | 91.0 | 92.0 | 93.7 |
| official: Qwen3-8B | 95.5 | 96.5 | 79.1 |
| official: GPT-4.1 | 91.0 | 89.0 | 86.5 |
| official: Llama-3.3-70B | 96.3 | 95.0 | 53.5 |
| official: Qwen3-0.6B | 86.5 | 86.0 | 80.8 |
Run greedy or at low temperature (kubehealth uses 0.2–0.3) with
repetition_penalty = 1.0; thinking stays on except for kubehealth's short note.
| File | Size |
|---|---|
magos-k8s-0.6b-q8_0.gguf |
~640 MB — recommended |
magos-k8s-0.6b-q4_k_m.gguf |
~400 MB |
magos-k8s-0.6b-f16.gguf |
~1.2 GB |
model.safetensors |
bf16, 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")
msgs = [{"role": "user", "content":
"Warning FailedScheduling: 0/3 nodes are available: 3 Insufficient memory. Why?"}]
prompt = tok.apply_chat_template(msgs, 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))
Previous versions: revision="v19", "v19-preview", "v17", "v16", "v15", "v8", …
| Base | Qwen/Qwen3-0.6B (no continued pre-training) |
| Method | LoRA r=64 / alpha 32, all linear layers, merged into the weights |
| Data | ~24.5k rows: ~15.9k kubehealth sessions (notes, analyses, RCA agent loops with tool calls, healthy objects with harmless noise, multi-hop investigations, and ~1.2k sessions with kubehealth's link-following evidence) whose prompts are identical to kubehealth's, plus ~8.6k plain-prose debugging and Kubernetes-mechanism Q&A. Synthetic, built from verified facts in the official Kubernetes, cert-manager, ingress-nginx, Helm, metrics-server, EKS/GKE/AKS documentation and Prometheus runbooks; uncertain claims were checked against those docs before training. Loss only on the model's own turns. |
| Recipe | 1 epoch, LR 2e-4 cosine, 5% warmup, ~65k tokens per step, seq len 4096 |
Apache 2.0 (inherits Qwen3-0.6B). Training data derived from official documentation (Kubernetes docs CC-BY 4.0; add-on and cloud-provider docs under their own licenses). Benchmarks: CloudEval-YAML (MIT), BFCL (Apache 2.0). Experimental model — verify commands and YAML before running them.
Qwen/Qwen3-0.6B