Ornith-1.0-9B-KubeOps 0.2.0 is a Brazilian Portuguese fine-tune of
deepreinforce-ai/Ornith-1.0-9B,
specialized in evidence-driven Kubernetes incident diagnosis and safe,
authorized recovery.
Version 0.2.0 adds a second, fully agentic operational fine-tuning stage.
Compared with 0.1.0, it places greater emphasis on deciding whether a change
is necessary, identifying the source of truth, executing the smallest
authorized and reversible correction, observing the resulting state, and
validating the affected service end to end.
The model was trained to:
discover the actual cluster state before forming a diagnosis;
distinguish observations, hypotheses, proposed actions, executed actions,
and validated results;
choose explicitly between correcting, waiting for healthy convergence,
making no change, or reporting a concrete blocker;
use kubectl, Helm, GitOps, KEDA, and operator ownership as sources of truth
when represented by the incident;
prefer read-only discovery and execute mutations only when authorization and
evidence make them appropriate;
apply the smallest safe and reversible correction instead of making broad
changes;
handle one failed correction with a bounded alternative or rollback path;
observe the workload after a change and validate the Service, EndpointSlice,
route, or application flow separately;
finish with exactly one clear operational state: resolved, mitigated,
partial, no change required, or blocked.
This repository contains the merged Transformers checkpoint. The LoRA adapter
has already been merged into the model and does not need to be loaded
separately.
Scope
Recommended uses
troubleshooting Pods, Deployments, StatefulSets, Services, Ingress, and
Gateway API resources;
1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
34MODEL_ID ="leandroxk/ornith-1.0-9b-kubeops"56tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)7model = AutoModelForCausalLM.from_pretrained(8 MODEL_ID,9 dtype="auto",10 device_map="auto",11)1213messages =[14{15"role":"system",16"content":(17"You are a KubeOps assistant. Ground decisions in observed "18"evidence. When a correction is explicitly authorized, apply "19"the smallest safe change and validate the resulting service."20),21},22{23"role":"user",24"content":(25"The checkout service is unavailable in the production "26"namespace. Investigate the incident. You may apply the minimum "27"safe correction after confirming the cause."28),29},30]3132inputs = tokenizer.apply_chat_template(33 messages,34 add_generation_prompt=True,35 return_dict=True,36 return_tensors="pt",37).to(model.device)3839with torch.inference_mode():40 output = model.generate(41**inputs,42 max_new_tokens=1024,43 do_sample=True,44 temperature=0.6,45 top_p=0.95,46 top_k=20,47)4849new_tokens = output[0, inputs["input_ids"].shape[-1]:]50print(tokenizer.decode(new_tokens, skip_special_tokens=True))
The model retains Ornith's reasoning behavior and may produce <think> blocks.
In public applications, handle this content separately and expose only the
final answer to end users.
Tool use
The included chat_template.jinja accepts tools in the Transformers
function-calling format. The 0.2.0 training dataset used a generic
run_command tool:
python
1tools =[2{3"type":"function",4"function":{5"name":"run_command",6"description":(7"Run a diagnostic or corrective command and return its exit "8"code, standard output, and standard error."9),10"parameters":{11"type":"object",12"properties":{13"command":{"type":"string"},14"timeout_seconds":{15"type":"integer",16"minimum":1,17"maximum":600,18},19},20"required":["command","timeout_seconds"],21"additionalProperties":False,22},23},24}25]2627inputs = tokenizer.apply_chat_template(28 messages,29 tools=tools,30 add_generation_prompt=True,31 return_dict=True,32 return_tensors="pt",33).to(model.device)
Tool calls are serialized as XML <tool_call> blocks. When serving with vLLM,
use a compatible parser:
The host application is responsible for deciding which commands are allowed,
executing them, returning their results to the model, and enforcing
authorization. In production, use command allowlists, execution and output
limits, redact Secrets, separate read-only and mutating permissions, and
require explicit approval before every mutation.
Training data
The model was trained in two successive SFT stages using synthetic, curated
data written in Brazilian Portuguese. The first stage combined conventional
answers with agentic troubleshooting trajectories. The second stage was fully
agentic and expanded operational incident resolution with no-change decisions,
zero-replica recovery, failure of the first correction, rollback and
alternative actions, and reconciliation through the actual source of truth.
Tool results in these trajectories are synthetic and must not be interpreted as
records captured from real clusters. The figures below aggregate both training
stages. Topic families are disjoint across stages, and family separation
between the combined training and validation splits remains complete.
Item
Value
Total records
888
Topic families
370
Training split
706 records / 295 families
Validation split
182 records / 75 families
Family overlap between splits
0
Conventional answers
315
Agentic trajectories
573
Tool calls
3,018
Language
pt-BR
Schema
agentic_sft_v5.0
Across both stages, the trajectories were generated with xiaomi/mimo-v2.5
and reviewed with
deepseek/deepseek-v4-flash, with configured fallback review and sampled
adjudication. They use reviewed synthetic fixtures and the
structured_synthetic_trajectory_with_critic_review generation method.
Training
Both stages used QLoRA with loss computed only on assistant tokens. Evaluation
and checkpoint saving ran at the end of each epoch; the best checkpoint from
each stage was loaded and merged before the next model version. Unless stated
otherwise, the parameters were shared by both stages.
Parameter
Value
SFT stages
2
Epochs per stage
2
Maximum sequence length, first stage
4,096 tokens
Maximum sequence length, second stage
8,192 tokens
Per-device batch size
1
Gradient accumulation
8
Learning rate
2e-4
Scheduler
linear
Optimizer
AdamW fused
Training precision
BF16
Training-time quantization
4-bit
Gradient checkpointing
enabled
Assistant-only loss
enabled
Evaluation and save strategy
epoch
Seed
42
LoRA rank
16
LoRA alpha
32
LoRA dropout
0.05
LoRA bias
none
LoRA modules
q, k, v, o, gate, up, and down projections
The merged checkpoint is stored in FP16. The architecture declares a
262,144-token context window, but the second supervised fine-tuning stage was
limited to 8,192 tokens. This fine-tune has not been specifically evaluated on
very long contexts.
Evaluation
The metrics below come from the held-out validation split of the second
fine-tuning stage. Families were kept separate across splits so variants of the
same topic could not appear in both.
Metric
Epoch 1
Epoch 2 / best
Validation loss
0.5188
0.5150
Mean token accuracy
0.8515
0.8529
These metrics measure fit to the supervised dataset. On their own, they do not
demonstrate incident-resolution rate, command safety, or improvement over
version 0.1.0 or the base model. No comparative Kubernetes benchmark or human
evaluation on real clusters has been completed.
Limitations and safety
The model may still hallucinate resources, namespaces, labels, containers,
symptoms, causes, command output, or successful recovery.
Tool output may be incomplete, stale, sensitive, or ambiguous.
Authorization described in a prompt does not replace authorization controls
enforced by the host application.
A plausible suggestion or successful command exit code does not replace
post-change workload and service validation.
Suggested commands may be incompatible with the Kubernetes version,
installed CRDs, reconciler, or local policies.
The model may select the wrong source of truth or propose a live change that
a controller later reverts.
Performance outside Brazilian Portuguese has not been specifically evaluated
for this fine-tune.
Before applying a correction:
confirm the active context, cluster, target, and impact;
validate namespaces and identifiers using observed tool results;
identify whether Kubernetes, Helm, GitOps, KEDA, or an operator owns the
desired state;
begin with read-only evidence and confirm that a change is necessary;
review every mutating command, constrain its scope, and prepare a rollback;
observe the workload after the change;
validate the Service, EndpointSlice, route, or affected application flow
separately;
treat an unresolved second correction as partial or blocked instead of
continuing an unbounded investigation.
Architecture and artifacts
Base architecture: deepreinforce-ai/Ornith-1.0-9B
Architecture: Qwen3_5ForCausalLM
Type: decoder-only causal language model
Parameter class: 9 billion
Layers: 32
Hidden size: 4,096
Attention heads: 16
KV heads: 4
Vocabulary: 248,320 tokens
Merged weights: FP16
License: MIT, inherited from the base model
F16, Q8_0, Q6_K, and Q4_K_M GGUF variants are available in the companion
leandroxk/ornith-1.0-9b-kubeops-GGUF
repository, with Q6_K recommended for its balance of quality and memory use.
They are not included in this Transformers repository.
License and attribution
This fine-tune is distributed under the base model's MIT license. See the
original Ornith-1.0-9B model card
for inherited architecture details, intended uses, and limitations.