> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreweave.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Tasks and traffic

> Create a stable task and connect your production Chat Completions application.

A task is the unit users optimize. It owns its data and experiments while giving the application one stable model name.

## Create a task

Select **Create task** and configure:

* **Alias:** The model string callers send.
* **W\&B project:** Optional. It defaults to the alias and stores task traces.
* **Initial model:** Optional routing target for version 1.
* **Proxy backend:** Cloudflare for hosted traffic. Local is available only in environments that explicitly enable it.

If a W\&B project with the default alias already exists, choose **Use a different W\&B project** and enter that project explicitly to adopt it.

<Accordion title="API: Create a task (PUT /tasks/{alias})">
  The alias is part of the URL. `targets` is optional, but setting it here makes version 1 callable as soon as routing is applied.

  ```bash theme={"system"}
  curl --request PUT \
    --url "https://distillation.training.wandb.ai/v1/tasks/ticket-classifier" \
    --header "Authorization: Bearer $WANDB_API_KEY" \
    --header "Wandb-Entity: your-team" \
    --header "Content-Type: application/json" \
    --data '{
      "project": "ticket-classifier",
      "targets": [
        {"model_ref": "openai/gpt-5.6-sol", "weight": 1}
      ]
    }'
  ```

  See [Create a task](/model-distillation/reference/management) for the complete schema.
</Accordion>

## Connect the application

Keep the normal OpenAI client and change two values:

```python theme={"system"}
client = OpenAI(
    base_url="https://proxy.training.wandb.ai/v1",
    api_key=os.environ["WANDB_API_KEY"],
)

response = client.chat.completions.create(
    model="your-task",
    messages=messages,
    extra_body={
        "metadata": {
            "wandb.entity": "your-team",
            "wandb.thread_id": conversation_id,
        }
    },
)
```

All normal Chat Completions fields are forwarded. The proxy replaces the task alias with the selected target's provider model and applies that target's stored parameter overrides.

## Verify useful traces

Before collecting a large dataset, confirm:

* successful calls appear in the task's request chart;
* traffic share matches routing weights;
* a stable `wandb.thread_id` groups each conversation;
* tool definitions, response formats, and multi-turn messages appear in the recorded request;
* failed provider calls are visible for debugging but excluded from training data.

<Tip>
  Send the complete message history on every call. Each trace becomes one self-contained training example representing the assistant response produced for that history.
</Tip>
