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

# Example library

> Runnable Rust programs for models, APIs, databases, typed agents and structured streams.

Pick a program, run the command and adapt the model. Each recipe lists the source path, required features and the result to look for.

Choose a recipeRun it locallyAdapt the model

> **[Models and protocols](/examples/models)**
>
> Signup validation, tagged tool calls, borrowed JSON, async checks, dates and Cap’n Proto.

> **[APIs and storage](/examples/services)**
>
> Axum CRUD, SQLite, PostgreSQL, MySQL and automatic migrations.

> **[Agents and streaming](/examples/agents)**
>
> Offline correction, partial/list streams, resumable graphs, live providers and multimodal inputs.

> **[Follow a tutorial](/tutorials/overview)**
>
> Build an application step by step with explanations and expected output.

## Run from the source checkout

```sh theme={"system"}
git clone https://github.com/trotsky1997/Rydantic.git
cd Rydantic
cargo run --locked -p rydantic --example data_contract
cargo run --locked -p rydantic-ai --no-default-features --example typed_agent
```

Use the source revision that matches these docs. Examples added in a pull request preview become available on `main` after merge. The project is tested with Rust **1.98.1**.

## Choose your environment

| Prerequisite | Examples |
| - | - |
| Rust and Cargo only | Core models, async checks, offline agents, structured streams and graphs |
| Bundled SQLite | Local HTTP APIs and migration examples |
| Cap’n Proto compiler | `auto_capnp` and generated Rust bindings |
| A local test database | PostgreSQL/MySQL driver examples |
| Configured model API | Live providers, image and PDF examples |

The offline AI recipes use deterministic demonstration responses. Live recipes use `BASEURL`, `MODEL` and optional `APIKEY`; the Jev recipe requires both `TYPESAFE_BASEURL` and `TYPESAFE_APIKEY`. Keep credentials in your local environment.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.