dynamo/lib/bindings/python/codegen
Biswa Panda cec19d4db6
feat(perf): add request-plane, transport, and work-handler metric definitions (#6735)
2026-03-14 07:36:31 +00:00
..
src feat(perf): add request-plane, transport, and work-handler metric definitions (#6735) 2026-03-14 07:36:31 +00:00
templates chore: nuke ForwardPassMetrics (#5531) 2026-01-23 16:26:01 +00:00
Cargo.toml chore: cargo machete - remove unused dependencies (#6453) 2026-02-20 19:11:52 +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.