cd /news/developer-tools/crusoe-is-now-a-pydantic-ai-model-pr… · home topics developer-tools article
[ARTICLE · art-96763] src=pydantic.dev ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

Crusoe is now a Pydantic AI model provider

Crusoe is now a native model provider in Pydantic AI, enabling developers to run agents on Crusoe Managed Inference with a single string like 'crusoe:zai/GLM-5.2'. The integration, contributed upstream to the pydantic-ai repository, provides streaming, tool calling, structured output, and per-family model profiles for open models including GLM, Llama, DeepSeek, Qwen, Gemma, gpt-oss, Kimi, and NVIDIA Nemotron 3. Emmanuel Acheampong, Senior Developer Relations Manager at Crusoe, and Laís Carvalho, Developer Relations at Pydantic, co-authored the announcement.

read5 min views1 publishedAug 14, 2026
Crusoe is now a Pydantic AI model provider
Image: Pydantic (auto-discovered)

_The following is a guest post from Crusoe, written by Emmanuel Acheampong, Senior Developer Relations Manager. Co-authored by Laís Carvalho, Developer Relations at Pydantic.

Crusoe is now a native model provider in Pydantic AI. One string, 'crusoe:zai/GLM-5.2'

, and your agents run on Crusoe Managed Inference: streaming, tool calling, structured output, and the full open model catalog on the Crusoe Intelligence Foundry, all out of the box.

This post covers who we are, why we built the integration, and how to use it.

Why we built this

Crusoe is the cloud for AI, however you build it. Open models are a fast-growing part of that picture, and they deserve infrastructure built for them. Crusoe Managed Inference serves the open catalog end to end on the Crusoe Intelligence Foundry: GLM, Llama, DeepSeek, Qwen, Gemma, gpt-oss, Kimi, and the NVIDIA Nemotron™ 3 family, with day-zero support for new releases.

Serving open weights is half of that work. The other half is meeting developers in the open source tools they already use. Crusoe is an upstream provider in LiteLLM and now a native Pydantic AI provider. Each integration follows the same principle: contribute the code upstream, keep it maintained, and let the framework's own conventions handle configuration.

Nothing in this stack locks you in. The models are open weights, the frameworks are open source, and the provider described in this post lives in the pydantic-ai repository, not in a Crusoe SDK. The ecosystem gets stronger when open and closed keep pushing each other forward, and builders match each workload to the right model. That is the outcome we are investing in.

The problem

Plenty of teams were already running Pydantic AI agents against Crusoe. It worked, but it meant wiring up OpenAIProvider

with a custom base_url

, managing the API key by hand, and losing model profile inference along the way. Model profiles matter more than they sound: they tell Pydantic AI how each model family handles JSON schemas, tool definitions, and output formats. Point a generic OpenAI provider at a GLM or gpt-oss model and you get OpenAI defaults, which are not always the right ones.

A native provider removes all of that. The endpoint, the key handling, and the per-family profiles ship in the framework.

How it works

The integration adds a CrusoeProvider

to pydantic-ai

, following the same pattern as other OpenAI-compatible providers. Install Pydantic AI, or the slim package with the openai

group:

uv add logfire "pydantic-ai-slim[openai]"

Generate a key in the Crusoe Cloud console under Intelligence Foundry, then set it:

export CRUSOE_API_KEY="cr_..."

That is the whole setup. The shorthand string does the rest:

import logfire
from pydantic_ai import Agent

logfire.configure()
logfire.instrument_pydantic_ai()

agent = Agent('crusoe:zai/GLM-5.2')
result = agent.run_sync('In one sentence: why do open agent stacks matter in 2026?')

print(result.output)

Structured output works the way you would expect from Pydantic AI, because the provider infers the right profile for the model family:

import logfire
from pydantic import BaseModel
from pydantic_ai import Agent

logfire.configure()
logfire.instrument_pydantic_ai()

class GpuSpec(BaseModel):
    name: str
    memory_gb: int
    interconnect: str

agent = Agent('crusoe:zai/GLM-5.2', output_type=GpuSpec)
result = agent.run_sync('Summarize the NVIDIA HGX™ B200 as a spec.')

print(result.output)
#> name='NVIDIA HGX B200' memory_gb=1536 interconnect='5th-Gen NVLink (1.8 TB/s per GPU), PCIe Gen5'

If you need explicit control, construct the provider yourself:

import logfire
from pydantic_ai import Agent
from pydantic_ai.models.openai import OpenAIChatModel
from pydantic_ai.providers.crusoe import CrusoeProvider

logfire.configure()
logfire.instrument_pydantic_ai()

model = OpenAIChatModel(
    'meta-llama/Llama-3.3-70B-Instruct',
    provider=CrusoeProvider(api_key='your-api-key'),
)

agent = Agent(model)
result = agent.run_sync('Be concise. Defend the Oxford comma.')
print(result.output)

The provider also accepts a custom httpx.AsyncClient

or a preconfigured AsyncOpenAI

client, so it fits whatever connection pooling or proxy setup you already run.

Under the hood, CrusoeProvider

maps the supported model families to their correct Pydantic AI profiles: meta-llama

, deepseek-ai

, qwen

, google

(Gemma), moonshotai

(Kimi), zai

(GLM), and openai

(gpt-oss, which uses the harmony profile). Tool schemas and JSON output behave correctly per family without any configuration on your side. Families without an explicit profile fall back to OpenAI-compatible defaults.

Results and learnings

What you get from the pairing is a short list with a lot behind it. Pydantic AI brings the agent framework: type-safe outputs, tools, streaming, and evals through Pydantic Evals, with tracing through Pydantic Logfire. Crusoe brings the inference layer built for agent workloads. MemoryAlloy, our cluster-wide KV cache fabric, routes requests cache-aware, which matters for agents that re-send system prompts and accumulated history on every turn. Cached input pricing means the loop stays cheap as contexts grow.

The main learning from building the provider: the OpenAI-compatible pattern in Pydantic AI is well factored. The whole integration is one provider class, a profile map, and tests that mirror the existing Nebius provider. If you serve open models behind an OpenAI-compatible endpoint, contributing a provider is a weekend project, and the maintainers' review process makes the result better than what you started with.

Try it

Two steps: grab a key from the Intelligence Foundry, then uv add logfire "pydantic-ai-slim[openai]"

and point an Agent

at crusoe:

plus any model in the catalog.

Once that first agent runs:

: tools, streaming, dependency injection, and multi-agent flows. - Every example above calls logfire.configure()

. That isPydantic Logfire, and it turns each run into a trace you can open: model calls, tool calls, retries, and token costs, queryable with SQL. ThePydantic AI integration docscover the setup, and the free tier is enough to watch your first agents work. Pydantic Evalsis worth reaching for when you start swapping models in the catalog and need to know whether the swap made things better.

If you build something interesting on this stack, we would love to hear about it. Reach the Crusoe developer community at devcommunity@crusoe.ai, and follow Crusoe for Developers on LinkedIn and @crusoedev on X for model launches, cookbook drops, and more walkthroughs.

An agent framework with validation at its core, and inference built for agents underneath it. That is the stack we wanted to use ourselves, so we wired it in.

── more in #developer-tools 4 stories · sorted by recency
── more on @crusoe 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/crusoe-is-now-a-pyda…] indexed:0 read:5min 2026-08-14 ·