LLM providers
Provider components install Sample middleware so a document can talk to cloud or local models with no custom runtime wiring. Model routing is by the model prop.
Built-in providers
These ship in packages/core/components/:
AnthropicProvider.md— cloud models via the Anthropic API.OllamaProvider.md— local models via a running Ollama server.LlamafileProvider.md— local models via llamafile.Sample.md— the sampling call itself.Instruction.md— surfaces a system prompt as visible, composable content.
One document, two models
Providers nest. <Sample> routes each prompt to the matching model and combines the results — all in a single markdown file.
packages/core/examples/hello-world.md
---
title: Hello World
---
# {meta.title}
<AnthropicProvider model="claude-opus-4-5">
<OllamaProvider model="llama3.2">
<Instruction system="You are a creative comedian.">
<Sample model="llama3.2">
Smart: <Sample prompt="Say something smart" model="claude-opus-4-5" />
Joke: <Sample prompt="Tell me a joke" model="llama3.2" />
Combine Smart and Joke into one smart joke
</Sample>
</Instruction>
</OllamaProvider>
</AnthropicProvider>Running provider documents
For this release, provider documents need the built-in components on the search path:
xmd run packages/core/examples/hello-world.md --component-dir packages/core/componentsThe example above also needs an ANTHROPIC_API_KEY in the environment and a local Ollama server running llama3.2. Embedding the built-in components into the binary (so --component-dir isn't required) is on the roadmap.
Next: Reference →