Installation
Turn ships as one CLI with official Wasm provider drivers bundled. Install it, select providers for infer and decide, then run.
1. Install the Turn 2 preview
Until the final Turn 2 tag is published, install the reviewed preview commit with Cargo:
cargo install --git https://github.com/ekizito96/Turn --rev 4934d479e4b96cde7fa531c54a4ec64400c1fe27 turnThis installs the exact runtime used by the website playground.
Verify the installation and selected providers:
turn --version
# turn 2.0.0
turn doctorLatest tagged stable release
The one-line installer currently installs stable v1. It will move to Turn 2 after the live-provider smoke test and release tag:
curl -fsSL https://turn-lang.dev/install.sh | shBuild from source
git clone https://github.com/ekizito96/Turn.git
cd Turn
git checkout 4934d479e4b96cde7fa531c54a4ec64400c1fe27
cargo install --path impl
turn doctor2. Select providers
Turn keeps generation and bounded judgment separate:
# Open-ended synthesis through infer
export TURN_LLM_PROVIDER=openai
export OPENAI_API_KEY=sk-...
# Choice, Score, and Noul decisions through decide
export TURN_DECISION_PROVIDER=typesafe
export TYPESAFE_API_KEY=your-key
turn doctorIf unset, TURN_LLM_PROVIDER defaults to openai and TURN_DECISION_PROVIDER defaults to typesafe.
Official adapters are bundled. A project-local .turn_modules/<provider>_provider.wasm file overrides the bundled version.
Generative providers
| Provider | TURN_LLM_PROVIDER | Required environment |
|---|---|---|
| OpenAI | openai | OPENAI_API_KEY |
| Anthropic | anthropic | ANTHROPIC_API_KEY |
| Google Gemini | gemini | GEMINI_API_KEY |
| xAI Grok | grok | XAI_API_KEY |
| Ollama | ollama | none |
| Azure OpenAI | azure_openai | endpoint, key, deployment |
| Azure Anthropic | azure_anthropic | endpoint, key |
| Azure OpenAI Responses | azure_openai_responses | endpoint, key, deployment |
Decision providers
| Provider | TURN_DECISION_PROVIDER | Required environment |
|---|---|---|
| TypeSafe Jev | typesafe | TYPESAFE_API_KEY |
| Deterministic development mock | mock | none |
NOTE
The mock validates control flow and response handling. It does not measure model quality, accuracy, or calibration.
3. Run a decision workflow
let decision = decide("The export button crashes in Safari", {
"department": {
"type": "choice",
"instructions": "Which team should handle this?",
"criteria": {
"billing": "Charges and refunds",
"technical": "Bugs and integrations"
}
}
});
return decision["answers"]["department"];Run without an API key:
TURN_DECISION_PROVIDER=mock turn run triage.tnRun the same program with Jev:
export TURN_DECISION_PROVIDER=typesafe
export TYPESAFE_API_KEY=your-key
turn run triage.tn4. CLI reference
turn run <file.tn> Run a Turn program
turn run <file.tn> --sandbox
Deny host I/O, imports, and identity grants
turn inspect <agent-id> Inspect a saved suspended process
turn serve [--port 3000] Start the HTTP API server
turn lsp Start the Language Server
turn doctor Check provider and credential readiness
turn --version Print version