Guidance for coding agents (Claude Code, Codex, and others) working in this repository.
OME (Open Model Engine) is a Kubernetes operator for serving Large Language Models. It manages models and serving runtimes as custom resources, matches models to runtimes via weighted scoring, and generates the Kubernetes workloads that serve them. Go module: sigs.k8s.io/ome.
make test— full unit-test suite with coverage. Runsfmt,vet,manifests, downloads envtest binaries, and builds the Rustpkg/xetlibrary first (requires a Rust toolchain).make test-no-xet— same suite but skips the Rust xet build and theome-agentcmd tests. Use this when no Rust toolchain is available.- Single test: envtest-backed packages need
KUBEBUILDER_ASSETS, e.g.KUBEBUILDER_ASSETS="$(./bin/setup-envtest use 1.35 -p path)" go test ./pkg/controller/... -run TestName(see theTEST_ENVblock in the Makefile for the full environment). Pure-unit packages work with plaingo test ./pkg/<pkg>/... -run TestName. make integration-test— Ginkgo tests undertests/.make ci-lint/make lint-fix— golangci-lint;make fmt,make vet,make tidybefore submitting.make generate && make manifests— REQUIRED after any change topkg/apis/. Regenerates deepcopy methods, client-go libraries, and the CRD/webhook/RBAC manifests inconfig/crd/full.make dep-crds— vendors optional third-party CRDs (KEDA, Gateway API, Kueue, scheduler-plugins) needed by some tests.make ome-manager/make model-agent/make ome-agent— build the individual binaries.
Three binaries in cmd/:
- manager — the operator control plane. Controllers live in
pkg/controller/v1beta1/(inferenceservice is the core one: runtime selection, workload generation for Deployments/LeaderWorkerSet, traffic/ingress reconcilers, canary and blue-green rollout groups). Admission webhooks live inpkg/webhook/. - model-agent — node-level agent that downloads models and parses metadata (architecture, parameter count, capabilities).
- ome-agent — job/sidecar agent for model download (Hugging Face, with Xet support via the Rust FFI library in
pkg/xet/), replication, fine-tuned-adapter handling, and model encryption (enigma).
Key packages:
pkg/apis/ome/v1beta1/— all CRD types (BaseModel/ClusterBaseModel, ServingRuntime/ClusterServingRuntime, InferenceService, FineTunedWeight, AcceleratorClass, BenchmarkJob). The WorkloadCluster and InferenceReplica APIs are merged but multi-cluster reconciliation is still in development — do not describe multi-cluster as a finished feature.pkg/runtimeselector/— weighted scoring that matches models to serving runtimes.pkg/acceleratorclassselector/— GPU selection policies (BestFit, Cheapest, MostCapable).charts/—ome-crdmust be installed beforeome-resources;ome-servingis an optional add-on of pre-configured models/runtimes/services.config/models/andconfig/runtimes/— the catalog of pre-configured models and SGLang (srt) / vLLM runtime definitions.oeps/— OME Enhancement Proposals. Major features and API changes require an OEP (see CONTRIBUTING.md); checkoeps/<n>/oep.yamlfor status before building on in-progress designs.site/— Hugo documentation site. Use Node 20 sopackage-lock.jsonstays in sync with CI.hack/docs-examples/andhack/docs-drift/— tooling for the redesigned documentation site, which lives in ome-projects/ome-docs and replacessite/at launch. That repository's CI runs these tools from a checkout of this one, at the commit pinned in itsome.ref, so keep them working when the API types or CRDs change. It also generates its API reference from the Go types inpkg/apis/ome/v1beta1, with its own templates. Until launch, documentation changes still go tosite/.
- Always DCO sign off (
git commit -s); every commit carries aSigned-off-by:trailer. - Author and sign-off identity must be the GitHub noreply address from
git config user.name/user.email(<id>+<user>@users.noreply.github.com) — never a real email address. - Never include AI attribution: no
Co-Authored-By: Claude(or anynoreply@anthropic.com) trailers, no "Generated with ..." lines, in commit messages or PR bodies.
- PR titles must carry one prefix:
[Bugfix],[Core],[API],[Helm],[Docs],[CI/Tests],[Misc], or[OEP]. Keep commit titles ≤52 characters, body lines ≤72. - Code follows the Google Go Style Guide.
- Pre-commit hooks are configured (
pip install pre-commit && pre-commit install); they run gofmt, go vet, helm-lint (warnings as errors), codespell, and site lockfile sync. - Bug fixes need a test that fails without the fix; rebase on latest
mainbefore submitting.