yaml-edit
A 12,867-parameter experimental model that turns a plain-language request into a proposed edit to an existing Kubernetes Deployment scalar. A separate, deterministic editor validates the proposal and preserves the source document's comments and formatting outside the edited value.
Research release, not a trusted editor. The model can misunderstand requests, choose the wrong field, or propose an edit when it should refuse. The larger synthetic evaluation produced 17 wrong edits among 47 proposals; a small public YAML pilot produced 2 wrong edits among 4 proposals. Always review the diff. Publication does not change the experimental, default-off status of learned inference.
Quickstart
Download this repository with its directory structure intact. Python 3.12+ and uv 0.9+ are required for the commands below. From the downloaded directory:
uv sync --locked --extra ml
work=$(mktemp -d)
uv run --locked --extra ml yaml-edit suggest examples/deployment.yaml \
--instruction 'Set api memory limit to 512Mi' \
--backend learned --allow-experimental --device cpu \
--config model.json --weights model.safetensors \
--output "$work/proposal.json"
This example should propose changing the api container's memory limit from
256Mi to 512Mi. Suggestions never modify the source file. Other requests may
return unsupported or needs_clarification, with no proposal file.
If a proposal exists, inspect the diff. Only after deciding it is correct, write a new YAML file with an explicit confirmation:
uv run --locked --extra ml yaml-edit preview examples/deployment.yaml \
--proposal "$work/proposal.json"
uv run --locked --extra ml yaml-edit apply examples/deployment.yaml \
--proposal "$work/proposal.json" --output "$work/edited.yaml" --yes
The original file stays unchanged. Existing output files are never overwritten. These commands do not contact a Kubernetes cluster or apply a deployment.
The lock uses CPU PyTorch wheels on Linux/Windows and the normal PyPI wheel on
macOS. No extra GPU is required. --device mps is an explicit alternative on
supported Macs; there is no silent CPU/MPS fallback. Dependency installation may
use the network; inference itself is local.
This is a custom PyTorch model, not a Transformers or AutoModel checkpoint. There
is no hosted text-generation widget, automatic model download or requirement to
use trust_remote_code. Review the included source before running it.
Supported edits and boundaries
Only existing scalar fields in supported, single-document Kubernetes Deployments:
- Replica count.
- A container image.
- Container CPU and memory requests and limits.
The learned interpreter proposes one edit per instruction. Field creation, deletion, arbitrary paths, document regeneration, compound natural-language edits, other Kubernetes resource kinds and multi-document YAML are outside this scope. The separate explicit batch-edit CLI is not a learned compound-instruction model.
Learned input bounds include 64 KiB UTF-8 YAML, one 512-byte instruction line, 64 actual candidates and 256 candidate/value attempts and retained actions. The loader validates strict JSON and bounded F32 safetensors; it does not load pickle.
The editor checks source binding, allowed targets and values, reparses the result, and verifies the one-value semantic invariant. These mechanical checks cannot prove that an instruction was understood or authorized. Kubernetes-wide schema, registry existence, capacity, organizational policy and operational correctness are not established by this model.
Model and training
A 384-to-32 MLP encodes fixed SHA-256 character n-gram/word features. A three-way disposition head selects supported, clarification or unsupported; a masked action scorer ranks a bounded list of candidates using 13 action features. The learned weights do not generate YAML. Parsing, field discovery, value extraction, action enumeration, validation and source-preserving editing remain deterministic.
- 12,867 F32 parameters, 51,468 raw parameter bytes.
model.safetensors: 51,924 bytes.model.json: architecture and calibrated thresholds, 367 bytes.- Seed: 202503; random initialization, no pretrained base model.
- Training/validation: 120/60 rows from a 240-row synthetic dataset; 60 test rows.
- CPU training, one thread; learning rate 0.01, batch size 24, weight decay 0.0001.
- 32 epochs completed; epoch 12 selected by validation loss, with patience 20.
- Disposition threshold 0.9; action threshold 0.5, selected using validation only.
The original small training run took approximately 7.55 seconds in its recorded local environment. This is not an inference-latency, memory-footprint or portable training-time guarantee; the PyTorch runtime is much larger than the weights.
The data are tiny, synthetic and correlated, not representative human-user traffic. The challenge instructions were separately agent-authored. Some test instruction text had been seen during development inspection; no score-based post-test tuning was reported, but these results must not be described as fully blinded. All reported evaluation banks are now exposed. This download is an inference package, not a complete training-reproduction or dataset release.
Historical evaluation of these exact weights
| Evaluation | Correct disposition | Exact supported edits | Wrong edits / proposals |
|---|---|---|---|
| Synthetic test, 60 requests | 44/60 | 26/42 | 0/26 |
| Separately authored challenge, 11 requests | 7/11 | 1/3 | 1/2 |
| Larger synthetic suite, 120 requests | 62/120 | 30/60 | 17/47 |
| Public YAML pilot, 20 instruction cases | 5/20 | 2/12 | 2/4 |
Disposition means the supported/clarification/unsupported classification. Exact supported edits use all supported requests as the denominator, including refusals. Wrong edits include proposals with the wrong target/value, or a proposal where refusal or clarification was required. These columns have different denominators and must not be combined into one accuracy figure.
The larger suite was agent-authored and safety-heavy; ten conditional cases were informed by an exposed failure category. The public pilot used 17 public manifests across 25 related cases, with agent-authored instructions—not actual user traffic. Five additional structural pilot cases were rejected correctly (5/5), but document boundary checks are not natural-language accuracy and are excluded from the 20-case instruction row. Reused documents and correlated cases do not justify population failure estimates or IID confidence intervals.
Known failures include proposing an edit for “If approved, set api memory limit to 512Mi,” ignoring negation, confusing requests with limits, choosing a field for an ambiguous instruction, and reducing a compound request to an unintended single edit. Valid, source-preserving YAML is not evidence of correct semantic intent. The rules baseline refused every case in the larger suite and public instruction pilot; its zero wrong edits reflected zero proposal coverage, not superiority.
These are retained historical measurements of the exact released checkpoint, not new capability results from publication checks. No later candidate's scores are attributed to these weights. No quality promotion, broad-English reliability, production-safety or general advantage over other models is claimed.
Integrity, license and contents
- Config SHA-256:
33032cb184803208523863cb6215d5a9b2fea07d80d86259621eb89d18657524. - Weights SHA-256:
616c150e2feedd139c50249f8215cb2cb1a431eda1d99394705fee47f3293498.
SHA256SUMS covers the supplied files except itself. Checksums establish integrity,
not publisher authenticity. The checkpoint is loaded only through explicit paths.
Code and model weights are MIT licensed. Dependencies retain their own licenses. This repository contains public model information, inference-only code, one example, dependencies, config and weights. It deliberately excludes internal design documents, raw experiment reports, training datasets and orchestration logs.