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

> ## Agent Instructions
> Install with `uv add whileai`; import as `import whileai as wai`.
> Run the offline path first (`simulator=False`, `wai.seeded_agent`, a callable judge); no key is needed for it.
> Report every pass rate with its interval and n, as `scored.pass_at` prints it.

# Integrations

> Every model API, trainer, GPU provider, data source and judge the SDK talks to, with the one line that connects each and the page that shows it running.

<div style={{ display: "flex", flexWrap: "wrap", gap: "12px 20px", alignItems: "center", margin: "8px 0 24px" }}>
  <a href="#models-the-agent-runs-on" title="OpenAI" style={{ display: "inline-flex", alignItems: "center", gap: "8px", textDecoration: "none" }}>
    <img className="block dark:hidden" src="https://mintcdn.com/crestoneai/XbE75Cy3pFOX-f2I/figures/logos/openai-light.svg?fit=max&auto=format&n=XbE75Cy3pFOX-f2I&q=85&s=07999b2b89e4517466c177805c747358" alt="OpenAI" style={{ height: "20px", width: "auto", margin: 0 }} width="24" height="24" data-path="figures/logos/openai-light.svg" />

    <img className="hidden dark:block" src="https://mintcdn.com/crestoneai/XbE75Cy3pFOX-f2I/figures/logos/openai-dark.svg?fit=max&auto=format&n=XbE75Cy3pFOX-f2I&q=85&s=7c059bf9eb44497772b07014b449a6d0" alt="OpenAI" style={{ height: "20px", width: "auto", margin: 0 }} width="24" height="24" data-path="figures/logos/openai-dark.svg" />
  </a>

  <a href="#models-the-agent-runs-on" title="Anthropic" style={{ display: "inline-flex", alignItems: "center", gap: "8px", textDecoration: "none" }}>
    <img className="block dark:hidden" src="https://mintcdn.com/crestoneai/XbE75Cy3pFOX-f2I/figures/logos/anthropic-light.svg?fit=max&auto=format&n=XbE75Cy3pFOX-f2I&q=85&s=00b5323cbd3e792c2ddf0198f36c917a" alt="Anthropic" style={{ height: "20px", width: "auto", margin: 0 }} width="24" height="24" data-path="figures/logos/anthropic-light.svg" />

    <img className="hidden dark:block" src="https://mintcdn.com/crestoneai/XbE75Cy3pFOX-f2I/figures/logos/anthropic-dark.svg?fit=max&auto=format&n=XbE75Cy3pFOX-f2I&q=85&s=834b9dcf94bd6fc1738d841426b8116c" alt="Anthropic" style={{ height: "20px", width: "auto", margin: 0 }} width="24" height="24" data-path="figures/logos/anthropic-dark.svg" />
  </a>

  <a href="#training" title="Fireworks" style={{ display: "inline-flex", alignItems: "center", gap: "8px", textDecoration: "none" }}>
    <img className="block dark:hidden" src="https://mintcdn.com/crestoneai/XbE75Cy3pFOX-f2I/figures/logos/fireworks-light.svg?fit=max&auto=format&n=XbE75Cy3pFOX-f2I&q=85&s=1b4fbec06e02a07b47803c2ab538813e" alt="Fireworks" style={{ height: "20px", width: "auto", margin: 0 }} width="88" height="44" data-path="figures/logos/fireworks-light.svg" />

    <img className="hidden dark:block" src="https://mintcdn.com/crestoneai/XbE75Cy3pFOX-f2I/figures/logos/fireworks-dark.svg?fit=max&auto=format&n=XbE75Cy3pFOX-f2I&q=85&s=427e662400ae63779470efeea9941648" alt="Fireworks" style={{ height: "20px", width: "auto", margin: 0 }} width="88" height="44" data-path="figures/logos/fireworks-dark.svg" />
  </a>

  <a href="#models-the-agent-runs-on" title="Amazon Bedrock" style={{ display: "inline-flex", alignItems: "center", gap: "8px", textDecoration: "none" }}>
    <img className="block dark:hidden" src="https://mintcdn.com/crestoneai/XbE75Cy3pFOX-f2I/figures/logos/amazonwebservices-light.svg?fit=max&auto=format&n=XbE75Cy3pFOX-f2I&q=85&s=1f84d984b3ac3f3bb6113d7a49d5ef64" alt="Amazon Bedrock" style={{ height: "20px", width: "auto", margin: 0 }} width="24" height="24" data-path="figures/logos/amazonwebservices-light.svg" />

    <img className="hidden dark:block" src="https://mintcdn.com/crestoneai/XbE75Cy3pFOX-f2I/figures/logos/amazonwebservices-dark.svg?fit=max&auto=format&n=XbE75Cy3pFOX-f2I&q=85&s=83113ad8926cb5bf54b0728a66dd968f" alt="Amazon Bedrock" style={{ height: "20px", width: "auto", margin: 0 }} width="24" height="24" data-path="figures/logos/amazonwebservices-dark.svg" />
  </a>

  <a href="#models-the-agent-runs-on" title="vLLM" style={{ display: "inline-flex", alignItems: "center", gap: "8px", textDecoration: "none" }}>
    <img className="block dark:hidden" src="https://mintcdn.com/crestoneai/XbE75Cy3pFOX-f2I/figures/logos/vllm-light.svg?fit=max&auto=format&n=XbE75Cy3pFOX-f2I&q=85&s=ece904abcba584ce82de770d38de7514" alt="vLLM" style={{ height: "20px", width: "auto", margin: 0 }} width="24" height="24" data-path="figures/logos/vllm-light.svg" />

    <img className="hidden dark:block" src="https://mintcdn.com/crestoneai/XbE75Cy3pFOX-f2I/figures/logos/vllm-dark.svg?fit=max&auto=format&n=XbE75Cy3pFOX-f2I&q=85&s=e08495d28751ea18d36ffb5922ad1fe8" alt="vLLM" style={{ height: "20px", width: "auto", margin: 0 }} width="24" height="24" data-path="figures/logos/vllm-dark.svg" />
  </a>

  <a href="#models-the-agent-runs-on" title="Ollama" style={{ display: "inline-flex", alignItems: "center", gap: "8px", textDecoration: "none" }}>
    <img className="block dark:hidden" src="https://mintcdn.com/crestoneai/XbE75Cy3pFOX-f2I/figures/logos/ollama-light.svg?fit=max&auto=format&n=XbE75Cy3pFOX-f2I&q=85&s=c980eda632136ec7aff28f5d2348310d" alt="Ollama" style={{ height: "20px", width: "auto", margin: 0 }} width="24" height="24" data-path="figures/logos/ollama-light.svg" />

    <img className="hidden dark:block" src="https://mintcdn.com/crestoneai/XbE75Cy3pFOX-f2I/figures/logos/ollama-dark.svg?fit=max&auto=format&n=XbE75Cy3pFOX-f2I&q=85&s=3e53e157bc9be73d5dbd6c6cf7405ec4" alt="Ollama" style={{ height: "20px", width: "auto", margin: 0 }} width="24" height="24" data-path="figures/logos/ollama-dark.svg" />
  </a>

  <a href="#training" title="Hugging Face and TRL" style={{ display: "inline-flex", alignItems: "center", gap: "8px", textDecoration: "none" }}>
    <img className="block dark:hidden" src="https://mintcdn.com/crestoneai/XbE75Cy3pFOX-f2I/figures/logos/huggingface-light.svg?fit=max&auto=format&n=XbE75Cy3pFOX-f2I&q=85&s=1479b5b7d077186827c1f4ec6e3e0b1d" alt="Hugging Face and TRL" style={{ height: "20px", width: "auto", margin: 0 }} width="24" height="24" data-path="figures/logos/huggingface-light.svg" />

    <img className="hidden dark:block" src="https://mintcdn.com/crestoneai/XbE75Cy3pFOX-f2I/figures/logos/huggingface-dark.svg?fit=max&auto=format&n=XbE75Cy3pFOX-f2I&q=85&s=a55c698ba72f9524a16e5130e8de0a90" alt="Hugging Face and TRL" style={{ height: "20px", width: "auto", margin: 0 }} width="24" height="24" data-path="figures/logos/huggingface-dark.svg" />
  </a>

  <a href="#training" title="Prime Intellect and verifiers" style={{ display: "inline-flex", alignItems: "center", gap: "8px", textDecoration: "none" }}>
    <img className="block dark:hidden" src="https://mintcdn.com/crestoneai/XbE75Cy3pFOX-f2I/figures/logos/primeintellect-light.svg?fit=max&auto=format&n=XbE75Cy3pFOX-f2I&q=85&s=983c8b2aecfc91c718817c183e70c645" alt="Prime Intellect and verifiers" style={{ height: "20px", width: "auto", margin: 0 }} width="51" height="34" data-path="figures/logos/primeintellect-light.svg" />

    <img className="hidden dark:block" src="https://mintcdn.com/crestoneai/XbE75Cy3pFOX-f2I/figures/logos/primeintellect-dark.svg?fit=max&auto=format&n=XbE75Cy3pFOX-f2I&q=85&s=316c6b10cd39ce26ec94483bb14a444a" alt="Prime Intellect and verifiers" style={{ height: "20px", width: "auto", margin: 0 }} width="51" height="34" data-path="figures/logos/primeintellect-dark.svg" />
  </a>

  <a href="#training" title="Modal" style={{ display: "inline-flex", alignItems: "center", gap: "8px", textDecoration: "none" }}>
    <img className="block dark:hidden" src="https://mintcdn.com/crestoneai/XbE75Cy3pFOX-f2I/figures/logos/modal-light.svg?fit=max&auto=format&n=XbE75Cy3pFOX-f2I&q=85&s=fd74deefdc523f26865b18471aae2fc2" alt="Modal" style={{ height: "20px", width: "auto", margin: 0 }} width="24" height="24" data-path="figures/logos/modal-light.svg" />

    <img className="hidden dark:block" src="https://mintcdn.com/crestoneai/XbE75Cy3pFOX-f2I/figures/logos/modal-dark.svg?fit=max&auto=format&n=XbE75Cy3pFOX-f2I&q=85&s=394f0b1b5f0726751e4de9e5917278ce" alt="Modal" style={{ height: "20px", width: "auto", margin: 0 }} width="24" height="24" data-path="figures/logos/modal-dark.svg" />
  </a>

  <a href="#data-in-and-out" title="OpenTelemetry" style={{ display: "inline-flex", alignItems: "center", gap: "8px", textDecoration: "none" }}>
    <img className="block dark:hidden" src="https://mintcdn.com/crestoneai/XbE75Cy3pFOX-f2I/figures/logos/opentelemetry-light.svg?fit=max&auto=format&n=XbE75Cy3pFOX-f2I&q=85&s=5be9517373594fd06c5ea2484661bb9a" alt="OpenTelemetry" style={{ height: "20px", width: "auto", margin: 0 }} width="24" height="24" data-path="figures/logos/opentelemetry-light.svg" />

    <img className="hidden dark:block" src="https://mintcdn.com/crestoneai/XbE75Cy3pFOX-f2I/figures/logos/opentelemetry-dark.svg?fit=max&auto=format&n=XbE75Cy3pFOX-f2I&q=85&s=665c1718f50d194858973fc39002a8ad" alt="OpenTelemetry" style={{ height: "20px", width: "auto", margin: 0 }} width="24" height="24" data-path="figures/logos/opentelemetry-dark.svg" />
  </a>
</div>

The SDK sits between your agent and your trainer. Everything below is a
string or one call; keys stay in your environment and never reach While.

## Models the agent runs on

The agent, the situation writer and the simulated person take the same spec
or backend object. [Connect your agent](/get-started/connect-your-agent) shows
each one in a run.

| Provider                                                   | How                                                                             | Key                                                         |
| ---------------------------------------------------------- | ------------------------------------------------------------------------------- | ----------------------------------------------------------- |
| OpenAI                                                     | `wai.OpenAI("gpt-4.1-mini")` or `"openai:<model>"`                              | `OPENAI_API_KEY`; `OPENAI_BASE_URL` for a compatible server |
| Anthropic                                                  | `wai.Anthropic("claude-haiku-4-5")` or `"anthropic:<model>"`                    | `ANTHROPIC_API_KEY`                                         |
| Fireworks                                                  | `wai.Fireworks("accounts/fireworks/models/qwen3-4b")` or `"fireworks:<model>"`  | `FIREWORKS_API_KEY`                                         |
| Amazon Bedrock                                             | `wai.models.Bedrock(model_id, region=)` or `"bedrock:<model-id>[@<region>]"`    | `AWS_BEARER_TOKEN_BEDROCK`, else AWS credentials            |
| vLLM, SGLang, TGI, LM Studio, any OpenAI-compatible server | `wai.Endpoint(model, url="http://localhost:8000/v1")` or `"vllm:<model>@<url>"` | `VLLM_API_KEY` when the server wants one                    |
| Ollama                                                     | `wai.Ollama("llama3")` or `"ollama:<model>"`                                    | none                                                        |
| The model While hosts                                      | `wai.Hosted()`, the default when nothing is configured                          | `whileai login`                                             |
| Your own code                                              | `my_agent(message) -> {"steps": [...], "final_text": "..."}`                    | yours                                                       |

## Judges

| Judge           | How                                                                          | Page                                        |
| --------------- | ---------------------------------------------------------------------------- | ------------------------------------------- |
| Any model above | `wai.Judge(rubric=..., model=wai.OpenAI("gpt-4.1"))`                         | [Evals](/evals)                             |
| TypeSafe Jev    | `"typesafe:<model>"` as the judge spec: one probability per verdict          | [Overview](/reference/overview)             |
| A verifier      | `wai.verify.MathEqual()`, `wai.verify.CodeExec(tests=...)`, or your function | [Verifiers](/recipes/01-simulate/verifiers) |

## Training

Rows leave the SDK in the shape each trainer reads, with the tool-call
round trip checked for that shape.

| Trainer                                         | How                                                                                         | Page                                                                                                |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| TRL (`SFTTrainer`, `DPOTrainer`, `GRPOTrainer`) | `select(mode="sft").export("train.jsonl", format="trl")`; `wai.HackMonitor` inside the loop | [SFT](/recipes/04-train/sft), [DPO](/recipes/04-train/dpo), [GRPO](/recipes/04-train/grpo)          |
| Fireworks managed training and serving          | `export(..., format="fireworks")`, then `firectl sftj create` and a deployment              | [Train on Fireworks](/recipes/04-train/fireworks)                                                   |
| prime-rl and verifiers on Prime Intellect       | `wai.prime_rl_config(...)` writes the run; `export_environment` writes the environment      | [prime-rl](/recipes/04-train/prime-rl), [Prime Intellect RL](/recipes/03-select/prime-intellect-rl) |
| Modal                                           | the training recipes run there on your account, one A10G                                    | [SFT](/recipes/04-train/sft), [Text-to-SQL](/recipes/04-train/text-to-sql)                          |
| While hosted GPUs                               | `wai.train(...)`, then `wai.serve(...)` gives back an OpenAI-compatible endpoint            | [Hosted loop](/recipes/04-train/hosted-loop)                                                        |

## Data in and out

| Source or destination    | How                                                                                                       | Page                                                  |
| ------------------------ | --------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
| OpenTelemetry traces     | `wai.simulations.rows_from_otel(batch)`, then `simulate(..., traces=rows)`                                | [Connect your agent](/get-started/connect-your-agent) |
| Your own traces as JSONL | `simulate(..., traces="traces.jsonl")`                                                                    | [Connect your agent](/get-started/connect-your-agent) |
| Hugging Face Hub         | `export(..., push_to="me/my-set")` for datasets, `wai.hub.push("out/adapter", "me/my-lora")` for adapters | [Hugging Face](/recipes/05-export/hugging-face)       |
| The While platform       | `push`, `train`, `serve`, and the experiments page that tracks every run                                  | [Platform](/platform)                                 |

Something you use is not here? [Open an issue](https://github.com/whilehq/whileai-sdk/issues/new)
with the provider and the call you expected.
