dynamo/lib/bindings/python/codegen
Keiven C 8e72fb69cf
docs: DYN-1967 update metrics docs after kvstats removal (#5704)
Signed-off-by: Keiven Chang <keivenchang@users.noreply.github.com>
Co-authored-by: Keiven Chang <keivenchang@users.noreply.github.com>
2026-01-27 17:24:12 -08:00
..
src docs: DYN-1967 update metrics docs after kvstats removal (#5704) 2026-01-27 17:24:12 -08:00
templates chore: nuke ForwardPassMetrics (#5531) 2026-01-23 16:26:01 +00:00
Cargo.toml chore: update all copyright headers in repo to 2026 (#5130) 2026-01-02 22:08:23 +00:00
README.md docs: DYN-1967 update metrics docs after kvstats removal (#5704) 2026-01-27 17:24:12 -08:00

README.md

Dynamo Codegen

Python code generator for Dynamo Python bindings.

gen-python-prometheus-names

Generates prometheus_names.py from Rust source lib/runtime/src/metrics/prometheus_names.rs.

Usage

cargo run -p dynamo-codegen --bin gen-python-prometheus-names

What it does

  • Parses Rust AST from lib/runtime/src/metrics/prometheus_names.rs
  • Generates Python classes with constants at lib/bindings/python/src/dynamo/prometheus_names.py

Example

Rust input:

pub mod kvrouter {
    pub const KV_CACHE_EVENTS_APPLIED: &str = "kv_cache_events_applied";
}

Python output:

class kvrouter:
    KV_CACHE_EVENTS_APPLIED = "kv_cache_events_applied"

When to run

Run after modifying lib/runtime/src/metrics/prometheus_names.rs to regenerate the Python file.