Rename the marker decorator in apis/common/tracing.py from trace_protocol
to mark_as_traced to disambiguate it from the actual tracing implementation
decorator in core/telemetry/trace_protocol.py.
Changes:
- Rename decorator: trace_protocol -> mark_as_traced
- Rename attribute: __trace_protocol__ -> __marked_for_tracing__
- Update all API protocol files to use new decorator name
- Update router logic to check for new attribute name
This makes it clear that the marker decorator is metadata-only and doesn't
perform actual tracing, while the core decorator does the implementation.
Signed-off-by: Charlie Doern <cdoern@redhat.com>
Remove circular dependency by moving tracing from API protocol definitions
to router implementation layer.
Changes:
- Create apis/common/tracing.py with marker decorator (zero core dependencies)
- Add @trace_protocol marker decorator to 11 protocol classes
- Apply actual tracing in core/routers/__init__.py based on protocol marker
- Move MetricResponseMixin from core to apis (it's an API response type)
- APIs package is now self-contained with zero core dependencies
The tracing functionality remains identical - actual trace_protocol from core
is applied to router implementations at runtime when both telemetry is enabled
and the protocol has the __trace_protocol__ marker.
## Test Plan
Manual integration test confirms identical behavior to main branch:
```bash
llama stack list-deps --format uv starter | sh
export OLLAMA_URL=http://localhost:11434
llama stack run starter
curl -X POST http://localhost:8321/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model": "ollama/gpt-oss:20b",
"messages": [{"role": "user", "content": "Say hello"}],
"max_tokens": 10}'
Verified identical between main and this branch:
- trace_id present in response
- metrics array with prompt_tokens, completion_tokens, total_tokens
- Server logs show trace_protocol applied to all routers
Existing telemetry integration tests (tests/integration/telemetry/) validate
trace context propagation and span attributes.
Signed-off-by: Charlie Doern <cdoern@redhat.com>
This PR removes all routes which we had marked deprecated for the 0.3.0
release.
This includes:
- all the `/v1/openai/v1/` routes (the corresponding /v1 routes still
exist of course)
- the /agents API (which is superseded completely by Responses +
Conversations)
- several alpha routes which had a "v1" route to aide transitioning to
"v1alpha"
This is the corresponding client-python change:
https://github.com/llamastack/llama-stack-client-python/pull/294
Migrates package structure to src/ layout following Python packaging
best practices.
All code moved from `llama_stack/` to `src/llama_stack/`. Public API
unchanged - imports remain `import llama_stack.*`.
Updated build configs, pre-commit hooks, scripts, and GitHub workflows
accordingly. All hooks pass, package builds cleanly.
**Developer note**: Reinstall after pulling: `pip install -e .`
2025-10-27 12:02:21 -07:00
Renamed from llama_stack/apis/inference/inference.py (Browse further)