instrumented_engine
diapason.telemetry.instrumented_engine
¶
Transparent telemetry wrapper for inference engines.
InstrumentedEngine
¶
Bases: InferenceEngine
Transparent wrapper that records telemetry around engine calls.
Agents call engine.generate() normally -- they don't know
about telemetry. The wrapper publishes INFERENCE_START,
INFERENCE_END, and TELEMETRY_RECORD events on the bus.
If an energy_monitor is provided (new multi-vendor
:class:~diapason.telemetry.energy_monitor.EnergyMonitor), it is
preferred over the legacy gpu_monitor for energy measurement.
generate(messages, *, model='', temperature=0.7, max_tokens=1024, **kwargs)
¶
Generate with telemetry recording.
stream(messages, *, model='', temperature=0.7, max_tokens=1024, **kwargs)
async
¶
Stream with per-token timing and full telemetry recording.
stream_full(messages, *, model, temperature=0.7, max_tokens=1024, **kwargs)
async
¶
Delegate to inner engine's stream_full for tool-call support.