Skip to content

Surface trace_id / provider / latency_ms on ChatCompletionChunk #17

Description

@MitulShah1

Non-streaming ChatCompletion surfaces Ferro-specific fields (trace_id, provider, latency_ms), but ChatCompletionChunk (ferrolabsai/types.py) only carries id / object / created / model / choices — the Ferro metadata is dropped for streaming responses.

If the gateway includes these on the final streaming chunk (e.g. via the x-trace-id header or a final-chunk body field), they should be captured and surfaced.

Why it matters

trace_id on streaming responses is the join key for LangSmith / Langfuse observability bridges — without it, streamed calls can't be correlated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestobservabilityTracing, metadata, trace_idstreamingStreaming (SSE) responses

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions