Back to Agent Lightning

Minimal Component Showcase

examples/minimal/README.md

0.3.01.7 KB
Original Source

Minimal Component Showcase

examples/minimal provides bite-sized programs that demonstrate how individual Agent-lightning building blocks behave in isolation.

Each module have been documented with its own CLI usage in the module-level docstring. Use this directory as a reference when wiring the same pieces into a larger system.

What’s Included?

ComponentDemonstrated InHighlights
LightningStore + OTLP ingestionwrite_traces.pyShows how OtelTracer and AgentOpsTracer open rollouts, emit spans, and optionally forward them to a remote store client.
MultiMetrics backendwrite_metrics.pyEmits counters/histograms through ConsoleMetricsBackend and PrometheusMetricsBackend simultaneously, exposing /metrics for scraping.
LLM proxyingllm_proxy.pyGuards either OpenAI or a local vLLM deployment with LLMProxy, proving how requests are routed through /rollout/<id>/attempt/<id> namespaces and captured in the store.
vLLM lifecyclevllm_server.pyMinimal context manager that shells out to vllm serve, monitors readiness, and tears down the process safely.

All runtime instructions (CLI arguments, required environment variables, etc.) are embedded directly in each script’s top-level docstring so the source stays self-documenting.

For full-fledged training workflows or multi-component experiments, browse the other subdirectories under examples/. This minimal folder deliberately keeps each demonstration focused on a single component so you can understand and test them independently.