Counting visitors…
Browse all docs
Start · 9Find your path through RunifoldLearn Runifold in 45 minutesUnderstand the complete Runifold platformYour first trustworthy runChoose the right execution APIChoose crates and Cargo featuresBuild common Runifold applicationsRunifold frequently asked questionsTroubleshoot Runifold applications
Execution kernel · 7Understand RunContextCoordinate external effects safelyBound work with budgets and cancellationHandle errors and retries safelyEvents, journals, and execution evidenceDesign capability-safe executionRecover safely from checkpoints
Models & providers · 7Route across models without duplicate outputChoose and configure a providerUse the provider-neutral model protocolBuild on the Provider Runtime contractUse OpenAI control-plane and Realtime APIsTest and benchmark provider adaptersSet up OpenAI, Anthropic, Gemini, and Ollama
Agents · 7Build and configure an AgentGive an Agent typed toolsAdd conversations and semantic memoryDelegate to child Agents safelyReturn structured Rust valuesStream without losing semanticsGround an Agent with retrieval
Durable workflows · 7Compose deterministic workflowsMake workflows durableOperate durable workflow workersCoordinate timers, signals, and durable waitsRun multi-tenant workflow infrastructureRun parallel branches and safe racesVersion and evolve durable workflows
Integrations · 7Connect through MCPChoose stores and persistence boundariesExpose durable work through MCP TasksBuild and evaluate retrieval pipelinesUse MCP Resources, Prompts, and SamplingCache MCP responses without crossing authorityDeploy Runifold in a Rust web service
Quality & operations · 10Test without the networkEvaluate quality and prevent regressionsObserve the complete run treeRun safely in browsers and at the edgeRead reliability claims preciselyRun reproducible evaluations in CIOperate Runifold with SLOsGovern Task retention and deletionArchive audit evidence to S3-compatible WORM storageManage compatibility and trusted releases
Docs/Models and providers
NEW TO RUNIFOLD?Build the complete mental model in 45 minutes
Models and providers

Set up OpenAI, Anthropic, Gemini, and Ollama

Install the runtime and one provider adapter, configure native or compatible clients, keep credentials server-side, and verify exact model capabilities.

Practical guide·10 min

Install one provider

Runifold 0.9 keeps concrete adapters in runifold-providers. Add the runtime facade and enable only the adapter your application deploys:

cargo add runifold@0.9.0
cargo add runifold-providers@0.9.0 --features openai
cargo add tokio --features macros,rt-multi-thread

Replace openai with anthropic, gemini, ollama, or bedrock. Named OpenAI-compatible modules such as DeepSeek, Ark, Groq and OpenRouter share the single openai protocol Feature instead of adding facade Features.

ProviderFeatureCredential or endpoint
OpenAIopenaiOPENAI_API_KEY
AnthropicanthropicANTHROPIC_API_KEY
GeminigeminiGEMINI_API_KEY
Ollamaollamalocal or hosted base URL
Bedrockbedrockapplication-provided AWS SDK configuration

Create native provider clients

Each native client implements the same provider model contract:

use runifold::ProviderModelExt;
use runifold_providers::{
    anthropic::AnthropicClient,
    gemini::GeminiClient,
    ollama::OllamaClient,
    openai::OpenAiClient,
};
 
let openai = OpenAiClient::from_api_key(
    std::env::var("OPENAI_API_KEY")?
)?.runtime("gpt-5")?;
 
let anthropic = AnthropicClient::from_api_key(
    std::env::var("ANTHROPIC_API_KEY")?
)?.runtime("claude-sonnet-4-5")?;
 
let gemini = GeminiClient::from_api_key(
    std::env::var("GEMINI_API_KEY")?
)?.runtime("gemini-2.5-flash")?;
 
let ollama = OllamaClient::local()?.runtime("llama3.2")?;

Model names are provider-controlled identifiers. Use a model available to your account and record the exact identifier in deployment configuration and test evidence.

Configure a compatible endpoint

For an application-owned gateway or a verified compatible service, declare the provider identity, endpoint, and wire protocol explicitly:

use runifold::ProviderModelExt;
use runifold_providers::{
    openai::{OpenAiClient, OpenAiConfig, OpenAiWireProtocol},
};
 
let config = OpenAiConfig::compatible(
    "private-gateway",
    std::env::var("MODEL_GATEWAY_KEY")?,
    "https://models.example.com/v1/",
    OpenAiWireProtocol::ChatCompletions,
)?;
 
let runtime = OpenAiClient::new(config)
    .runtime("organization/model-name")?;

Do not accept arbitrary base URLs from end users. Allowlist endpoints and treat “OpenAI-compatible” as a protocol claim, not a promise of identical Tool, streaming, reasoning, usage, or error semantics.

Keep credentials at the server boundary

Load long-lived credentials through the deployment secret store. Never put provider keys in source control, browser bundles, mobile applications, or WASM. Browser and edge clients should call an application-owned gateway that authenticates the user and adds upstream credentials server-side.

Log provider identity, model identity, request correlation, capability evidence, and sanitized error classification. Do not log secrets or raw sensitive content.

Verify the exact combination

Before production, prove four increasingly strong claims:

  1. the selected feature and example compile;
  2. offline protocol and error-classification tests pass;
  3. a live smoke test succeeds with the real endpoint;
  4. the exact model-feature combination is observed in production.

Structured output, Tools, images, reasoning, and usage may vary by model even inside one provider. Use Provider testing and reliability evidence rather than assuming support.