Skip to main content
Include proxy controls and trace attributes in the standard Chat Completions metadata object. This page explains how to preserve conversation identity, sample complete conversations, and understand the resulting project traces.

Reserved metadata

wandb.* keys control routing and logging. The proxy removes them before sending a request to the provider. The proxy forwards other metadata to the provider. When representable, the proxy also adds that metadata to the trace.

Conversation precedence

The proxy chooses the first available identifier:
  1. wandb.thread_id
  2. gen_ai.conversation.id
  3. Vapi call.id
Use the same value for every provider call in a conversation in your application. This improves browsing traces, prevents one conversation from spanning multiple dataset splits, and makes weighted routing stable.

Sample complete conversations

Conversation-level trace sampling reduces the volume of project traffic saved to W&B Weave without leaving partial conversations. Per-request sampling can keep isolated turns and discard the surrounding context, which makes the saved data less useful for debugging and dataset creation. To configure sampling for a project:
  1. In Model Distillation Studio, open the project’s Routing page.
  2. Under Models and traffic, set Weave trace sampling to the percentage of conversations to save.
  3. Select Save routing.
After you save the routing configuration, the proxy uses the selected percentage for conversation-level trace sampling. For requests with a conversation identity, the proxy assigns the conversation to a stable sampling group based on the W&B entity, Model Distillation project, and conversation ID. The default sampling rate is 100 percent. The proxy either saves or skips every request with that identity. The sampling decision is independent of model selection and routing revisions. Skipped traces don’t prevent the proxy from serving inference responses. The proxy always saves requests without a conversation identity. Keep the sampling percentage stable for the lifetime of active conversations because a change can affect which conversations are saved.
To configure conversation-level trace sampling without Model Distillation Studio, use the routing API.Replace [PROXY-MODEL-NAME] with the proxy model name, [WANDB-ENTITY] with the W&B entity, and [MODEL-REF] with an existing target model reference.Set trace_sampling_rate to a fraction from 0 to 1. Because a routing update replaces the complete configuration, include all existing targets in the request:
For another project version, use PUT /v1/tasks/[PROXY-MODEL-NAME]/versions/[PROJECT-VERSION]/routing. Replace [PROXY-MODEL-NAME] with the proxy model name and [PROJECT-VERSION] with the project version. Before you treat the setting as active, wait until the deployment status is Applied at the new routing revision.

Project trace contents

Project traces capture the following routing, request, response, and metadata details:
  • Project ID (UUID), proxy model name, and version
  • Routing revision and selected provider and model
  • The exact request that the proxy sends to the provider and the response that the proxy reconstructs.
  • Token usage, finish reason, timing, and error status
  • Whether the response was replayed from the exact-response cache (cache_hit)
  • Conversation, user, scenario, and safe custom metadata
  • A proxy request ID for support and comparison of trace outputs
The canonical Agent Span contains a raw copy of the request and response to preserve details. Dataset reconstruction doesn’t rely only on the normalized display columns.
Don’t put credentials, secrets, or unnecessary personal data in messages or metadata. Trace data is intentionally durable training and debugging input.
Replace [PROXY-MODEL-NAME] with the proxy model name, [WANDB-ENTITY] with the W&B entity, and [CONVERSATION-ID] with an identifier for the conversation.Keep the same wandb.thread_id for every turn in one conversation:
The proxy removes reserved wandb.* values before sending a request to the provider. See Create a routed chat completion.
Last modified on September 3, 2026