dynamo/lib/bindings/python/codegen
Ryan Olson 7a6283e927
chore: cargo machete - remove unused dependencies (#6453)
Signed-off-by: Ryan Olson <rolson@nvidia.com>
2026-02-20 19:11:52 +00:00
..
src fix: remove default-members in workspace (#6279) 2026-02-18 12:39:17 -05: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.