pydantic-ai
Routes agents working with Pydantic AI, pydantic-graph, pydantic-evals, clai, examples, and repository maintenance across focused workflow sub-skills.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- pydantic-ai
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Routes agents working with Pydantic AI, pydantic-graph, pydantic-evals, clai, examples, and repository maintenance across focused workflow sub-skills.
- disable-model-invocation
- true
02 资源文件 6
- 参考文档references/capability-map.md3.2 KB
- 参考文档references/installation-and-extras.md3.9 KB
- 参考文档references/repo-provenance.md2.8 KB
- 参考文档references/repo-routing-metadata.json498 B
- 参考文档references/troubleshooting.md3.8 KB
- 脚本scripts/check_environment.py6.3 KB
03 SKILL.md 正文
Pydantic AI Repo Skill
Use this repo skill when a task mentions Pydantic AI, imports pydantic_ai, edits the Pydantic AI monorepo, uses pydantic-graph, pydantic-evals, clai, or asks about agents, tools, models, providers, MCP, evals, graph workflows, CLI apps, tests, docs, cassettes, or maintainer workflows for this ecosystem.
Start Here
- Read references/repo-provenance.md before deciding whether this skill is current for a checkout or whether
refresh-repo-skillis needed. - Read references/installation-and-extras.md for package names, Python version support, extras, and minimal import checks.
- Read references/capability-map.md when choosing the best sub-skill or checking coverage boundaries.
- Read references/troubleshooting.md for cross-cutting install/import/provider/CLI/configuration problems.
- Run scripts/check_environment.py for a safe no-network diagnostic of installed Pydantic AI packages, optional extras, and CLI help.
Route by Task
| User task | Read |
|---|---|
Build, configure, run, stream, test, or compose Agent instances; use deps, instructions, message history, usage limits, AgentSpec, or TestModel |
sub-skills/agent-core/SKILL.md |
Define function tools, validate schemas, use RunContext, ModelRetry, approvals, deferred tools, tool search, or reusable toolsets |
sub-skills/tools-and-toolsets/SKILL.md |
Design structured outputs, output functions, ToolOutput, NativeOutput, multimodal inputs, message parts, or history serialization |
sub-skills/outputs-and-messages/SKILL.md |
| Choose model strings, provider classes, optional extras, profiles, native tools, embeddings, fallback, concurrency, or provider troubleshooting | sub-skills/models-and-providers/SKILL.md |
| Connect MCP/FastMCP, capabilities, hooks, Logfire, A2A, durable execution, AG-UI, Vercel AI, or web integration surfaces | sub-skills/mcp-and-integrations/SKILL.md |
Build Pydantic Evals datasets/evaluators/reports or pydantic-graph GraphBuilder workflows |
sub-skills/evals-and-graph/SKILL.md |
Use clai, pai, clai web, Agent.to_cli, Agent.to_web, custom agent loading, or app/example scaffolds |
sub-skills/cli-and-apps/SKILL.md |
| Edit this repository, choose targeted tests, record cassettes, update docs/examples, follow contribution rules, or refresh generated skills | sub-skills/repo-development/SKILL.md |
Install Baseline
Pydantic AI targets Python 3.10+ and is distributed as several related packages:
pip install pydantic-ai
pip install pydantic-ai-slim
pip install pydantic-graph pydantic-evals clai
Use pydantic-ai-slim[...] extras for optional providers and integrations. Do not install every extra by default; choose only the extras needed for the selected workflow.
Minimal import check:
import pydantic_ai
import pydantic_graph
import pydantic_evals
import clai
For deterministic code examples and tests, prefer pydantic_ai.models.test.TestModel or pydantic_ai.models.function.FunctionModel before making live provider requests.
Working Rules
- Use provider-prefixed model strings such as
openai:gpt-5.2,anthropic:claude-opus-4-6, andgoogle:gemini-3-pro-previewwhen examples intentionally call real providers. - Treat provider SDKs, credentials, native tools, MCP servers, durable backends, UI servers, and cloud resources as optional surfaces that need explicit install/config checks.
- Do not run live model requests, record cassettes, start durable services, upload files, or mutate cloud resources unless the user explicitly asks and provides credentials/configuration.
- For repository edits, follow the scoped
AGENTS.mdandagent_docs/guidance summarized in sub-skills/repo-development/SKILL.md. - Keep generated skill usage self-contained: use these bundled references and scripts instead of depending on the original source docs, examples, tests, or scripts unless the task is explicitly about maintaining a Pydantic AI checkout.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).