# outlines - Doramagic AI Context Pack

> 定位：安装前体验与判断资产。它帮助宿主 AI 有一个好的开始，但不代表已经安装、执行或验证目标项目。

## 充分原则

- **充分原则，不是压缩原则**：AI Context Pack 应该充分到让宿主 AI 在开工前理解项目价值、能力边界、使用入口、风险和证据来源；它可以分层组织，但不以最短摘要为目标。
- **压缩策略**：只压缩噪声和重复内容，不压缩会影响判断和开工质量的上下文。

## 给宿主 AI 的使用方式

你正在读取 Doramagic 为 outlines 编译的 AI Context Pack。请把它当作开工前上下文：帮助用户理解适合谁、能做什么、如何开始、哪些必须安装后验证、风险在哪里。不要声称你已经安装、运行或执行了目标项目。

## Claim 消费规则

- **事实来源**：Repo Evidence + Claim/Evidence Graph；Human Wiki 只提供显著性、术语和叙事结构。
- **事实最低状态**：`supported`
- `supported`：可以作为项目事实使用，但回答中必须引用 claim_id 和证据路径。
- `weak`：只能作为低置信度线索，必须要求用户继续核实。
- `inferred`：只能用于风险提示或待确认问题，不能包装成项目事实。
- `unverified`：不得作为事实使用，应明确说证据不足。
- `contradicted`：必须展示冲突来源，不得替用户强行选择一个版本。

## 它最适合谁

- **正在使用 Claude/Codex/Cursor/Gemini 等宿主 AI 的开发者**：README 或插件配置提到多个宿主 AI。 证据：`README.md` Claim：`clm_0002` supported 0.86

## 它能做什么

- **命令行启动或安装流程**（需要安装后验证）：项目文档中存在可执行命令，真实使用需要在本地或宿主环境中运行这些命令。 证据：`README.md` Claim：`clm_0001` supported 0.86

## 怎么开始

- `pip install outlines` 证据：`README.md` Claim：`clm_0003` supported 0.86

## 继续前判断卡

- **当前建议**：先做角色匹配试用
- **为什么**：这个项目更像角色库，核心风险是选错角色或把角色文案当执行能力；先用 Prompt Preview 试角色匹配，再决定是否沙盒导入。

### 30 秒判断

- **现在怎么做**：先做角色匹配试用
- **最小安全下一步**：先用 Prompt Preview 试角色匹配；满意后再隔离导入
- **先别相信**：角色质量和任务匹配不能直接相信。
- **继续会触碰**：角色选择偏差、命令执行、本地环境或项目文件

### 现在可以相信

- **适合人群线索：正在使用 Claude/Codex/Cursor/Gemini 等宿主 AI 的开发者**（supported）：有 supported claim 或项目证据支撑，但仍不等于真实安装效果。 证据：`README.md` Claim：`clm_0002` supported 0.86
- **能力存在：命令行启动或安装流程**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`README.md` Claim：`clm_0001` supported 0.86
- **存在 Quick Start / 安装命令线索**（supported）：可以相信项目文档出现过启动或安装入口；不要因此直接在主力环境运行。 证据：`README.md` Claim：`clm_0003` supported 0.86

### 现在还不能相信

- **角色质量和任务匹配不能直接相信。**（unverified）：角色库证明有很多角色，不证明每个角色都适合你的具体任务，也不证明角色能产生高质量结果。
- **不能把角色文案当成真实执行能力。**（unverified）：安装前只能判断角色描述和任务画像是否匹配，不能证明它能在宿主 AI 里完成任务。
- **真实输出质量不能在安装前相信。**（unverified）：Prompt Preview 只能展示引导方式，不能证明真实项目中的结果质量。
- **宿主 AI 版本兼容性不能在安装前相信。**（unverified）：Claude、Cursor、Codex、Gemini 等宿主加载规则和版本差异必须在真实环境验证。
- **不会污染现有宿主 AI 行为，不能直接相信。**（inferred）：Skill、plugin、AGENTS/CLAUDE/GEMINI 指令可能改变宿主 AI 的默认行为。
- **可安全回滚不能默认相信。**（unverified）：除非项目明确提供卸载和恢复说明，否则必须先在隔离环境验证。
- **真实安装后是否与用户当前宿主 AI 版本兼容？**（unverified）：兼容性只能通过实际宿主环境验证。
- **项目输出质量是否满足用户具体任务？**（unverified）：安装前预览只能展示流程和边界，不能替代真实评测。

### 继续会触碰什么

- **角色选择偏差**：用户对任务应该由哪个专家角色处理的判断。 原因：选错角色会让 AI 从错误专业视角回答，浪费时间或误导决策。
- **命令执行**：包管理器、网络下载、本地插件目录、项目配置或用户主目录。 原因：运行第一条命令就可能产生环境改动；必须先判断是否值得跑。 证据：`README.md`
- **本地环境或项目文件**：安装结果、插件缓存、项目配置或本地依赖目录。 原因：安装前无法证明写入范围和回滚方式，需要隔离验证。 证据：`README.md`
- **宿主 AI 上下文**：AI Context Pack、Prompt Preview、Skill 路由、风险规则和项目事实。 原因：导入上下文会影响宿主 AI 后续判断，必须避免把未验证项包装成事实。

### 最小安全下一步

- **先跑 Prompt Preview**：先用交互式试用验证任务画像和角色匹配，不要先导入整套角色库。（适用：任何项目都适用，尤其是输出质量未知时。）
- **只在隔离目录或测试账号试装**：避免安装命令污染主力宿主 AI、真实项目或用户主目录。（适用：存在命令执行、插件配置或本地写入线索时。）
- **安装后只验证一个最小任务**：先验证加载、兼容、输出质量和回滚，再决定是否深用。（适用：准备从试用进入真实工作流时。）

### 退出方式

- **保留安装前状态**：记录原始宿主配置和项目状态，后续才能判断是否可恢复。
- **保留原始角色选择记录**：如果输出偏题，可以回到任务画像阶段重新选择角色，而不是继续沿着错误角色推进。
- **记录安装命令和写入路径**：没有明确卸载说明时，至少要知道哪些目录或配置需要手动清理。
- **如果没有回滚路径，不进入主力环境**：不可回滚是继续前阻断项，不应靠信任或运气继续。

## 哪些只能预览

- 解释项目适合谁和能做什么
- 基于项目文档演示典型对话流程
- 帮助用户判断是否值得安装或继续研究

## 哪些必须安装后验证

- 真实安装 Skill、插件或 CLI
- 执行脚本、修改本地文件或访问外部服务
- 验证真实输出质量、性能和兼容性

## 边界与风险判断卡

- **把安装前预览误认为真实运行**：用户可能高估项目已经完成的配置、权限和兼容性验证。 处理方式：明确区分 prompt_preview_can_do 与 runtime_required。 Claim：`clm_0004` inferred 0.45
- **命令执行会修改本地环境**：安装命令可能写入用户主目录、宿主插件目录或项目配置。 处理方式：先在隔离环境或测试账号中运行。 证据：`README.md` Claim：`clm_0005` supported 0.86
- **待确认**：真实安装后是否与用户当前宿主 AI 版本兼容？。原因：兼容性只能通过实际宿主环境验证。
- **待确认**：项目输出质量是否满足用户具体任务？。原因：安装前预览只能展示流程和边界，不能替代真实评测。
- **待确认**：安装命令是否需要网络、权限或全局写入？。原因：这影响企业环境和个人环境的安装风险。

## 开工前工作上下文

### 加载顺序

- 先读取 how_to_use.host_ai_instruction，建立安装前判断资产的边界。
- 读取 claim_graph_summary，确认事实来自 Claim/Evidence Graph，而不是 Human Wiki 叙事。
- 再读取 intended_users、capabilities 和 quick_start_candidates，判断用户是否匹配。
- 需要执行具体任务时，优先查 role_skill_index，再查 evidence_index。
- 遇到真实安装、文件修改、网络访问、性能或兼容性问题时，转入 risk_card 和 boundaries.runtime_required。

### 任务路由

- **命令行启动或安装流程**：先说明这是安装后验证能力，再给出安装前检查清单。 边界：必须真实安装或运行后验证。 证据：`README.md` Claim：`clm_0001` supported 0.86

### 上下文规模

- 文件总数：249
- 重要文件覆盖：40/249
- 证据索引条目：80
- 角色 / Skill 条目：68

### 证据不足时的处理

- **missing_evidence**：说明证据不足，要求用户提供目标文件、README 段落或安装后验证记录；不要补全事实。
- **out_of_scope_request**：说明该任务超出当前 AI Context Pack 证据范围，并建议用户先查看 Human Manual 或真实安装后验证。
- **runtime_request**：给出安装前检查清单和命令来源，但不要替用户执行命令或声称已执行。
- **source_conflict**：同时展示冲突来源，标记为待核实，不要强行选择一个版本。

## Prompt Recipes

### 适配判断

- 目标：判断这个项目是否适合用户当前任务。
- 预期输出：适配结论、关键理由、证据引用、安装前可预览内容、必须安装后验证内容、下一步建议。

```text
请基于 outlines 的 AI Context Pack，先问我 3 个必要问题，然后判断它是否适合我的任务。回答必须包含：适合谁、能做什么、不能做什么、是否值得安装、证据来自哪里。所有项目事实必须引用 evidence_refs、source_paths 或 claim_id。
```

### 安装前体验

- 目标：让用户在安装前感受核心工作流，同时避免把预览包装成真实能力或营销承诺。
- 预期输出：一段带边界标签的体验剧本、安装后验证清单和谨慎建议；不含真实运行承诺或强营销表述。

```text
请把 outlines 当作安装前体验资产，而不是已安装工具或真实运行环境。

请严格输出四段：
1. 先问我 3 个必要问题。
2. 给出一段“体验剧本”：用 [安装前可预览]、[必须安装后验证]、[证据不足] 三种标签展示它可能如何引导工作流。
3. 给出安装后验证清单：列出哪些能力只有真实安装、真实宿主加载、真实项目运行后才能确认。
4. 给出谨慎建议：只能说“值得继续研究/试装”“先补充信息后再判断”或“不建议继续”，不得替项目背书。

硬性边界：
- 不要声称已经安装、运行、执行测试、修改文件或产生真实结果。
- 不要写“自动适配”“确保通过”“完美适配”“强烈建议安装”等承诺性表达。
- 如果描述安装后的工作方式，必须使用“如果安装成功且宿主正确加载 Skill，它可能会……”这种条件句。
- 体验剧本只能写成“示例台词/假设流程”：使用“可能会询问/可能会建议/可能会展示”，不要写“已写入、已生成、已通过、正在运行、正在生成”。
- Prompt Preview 不负责给安装命令；如用户准备试装，只能提示先阅读 Quick Start 和 Risk Card，并在隔离环境验证。
- 所有项目事实必须来自 supported claim、evidence_refs 或 source_paths；inferred/unverified 只能作风险或待确认项。

```

### 角色 / Skill 选择

- 目标：从项目里的角色或 Skill 中挑选最匹配的资产。
- 预期输出：候选角色或 Skill 列表，每项包含适用场景、证据路径、风险边界和是否需要安装后验证。

```text
请读取 role_skill_index，根据我的目标任务推荐 3-5 个最相关的角色或 Skill。每个推荐都要说明适用场景、可能输出、风险边界和 evidence_refs。
```

### 风险预检

- 目标：安装或引入前识别环境、权限、规则冲突和质量风险。
- 预期输出：环境、权限、依赖、许可、宿主冲突、质量风险和未知项的检查清单。

```text
请基于 risk_card、boundaries 和 quick_start_candidates，给我一份安装前风险预检清单。不要替我执行命令，只说明我应该检查什么、为什么检查、失败会有什么影响。
```

### 宿主 AI 开工指令

- 目标：把项目上下文转成一次对话开始前的宿主 AI 指令。
- 预期输出：一段边界明确、证据引用明确、适合复制给宿主 AI 的开工前指令。

```text
请基于 outlines 的 AI Context Pack，生成一段我可以粘贴给宿主 AI 的开工前指令。这段指令必须遵守 not_runtime=true，不能声称项目已经安装、运行或产生真实结果。
```


## 角色 / Skill 索引

- 共索引 68 个角色 / Skill / 项目文档条目。

- **Gemini**（project_doc）：You need to install the google.genai libray to be able to use the Gemini API in Outlines. Install all optional dependencies of the Gemini model with: pip install "outlines gemini " . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/features/models/gemini.md`
- **🚀 Building the future of structured generation**（project_doc）：Made with ❤👷️ by the team at .txt https://dottxt.co Trusted by NVIDIA, Cohere, HuggingFace, vLLM, etc. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`README.md`
- **Deploy Outlines on Beam**（project_doc）：1. Create an account here https://beam.cloud and install the Beam SDK 2. Download the app.py file to your computer 3. Deploy it as a serverless API by running: beam deploy app.py:predict 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`examples/beam-cloud/README.md`
- **Core concepts**（project_doc）：Coming soon. This will document various concepts at a high level, so users can understand Outlines before diving into specific implementations. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/core_concepts.md`
- **Index**（project_doc）：! assets/images/logo-light-mode.svg only-light { width="500" } ! assets/images/logo-dark-mode.svg only-dark { width="500" } 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/index.md`
- **API Reference**（project_doc）： 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/api_reference/index.md`
- **Blog**（project_doc）： 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/blog/index.md`
- **What contributions?**（project_doc）：- Documentation contributions are very valuable to us! - Examples. Show us what you did with Outlines : - Bug reports with a minimum working examples in the issue tracker issues - Bug fixes are always a pleasure to review. - New features . Please start a new discussion discussions , or come chat with us discord beforehand! 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/community/contribute.md`
- **Community projects and articles**（project_doc）：Publishing examples and articles about Outlines are a meaningful way to contribute to the community. Here is a list of projects we are aware of. Drop us a line if we forgot yours! 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/community/examples.md`
- **Feedback**（project_doc）：If Outlines has been helpful to you, let us know on Discord discord or give us a shoutout on Twitter twitter ! It's always heartwarming ❤️ 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/community/feedback.md`
- **Community**（project_doc）：Outlines exists for a community of users who believe software doesn't need to be complicated. Who share the same passion for Large Language Models but don't want to compromise on robustness. Together, we are bringing these powerful models back to the world of software. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/community/index.md`
- **Versioning Guide**（project_doc）：The Outlines project follows a structured versioning scheme designed to provide clarity and minimize risk for downstream dependents. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/community/versioning.md`
- **Summarize documents using Chain of Density prompting**（project_doc）：Summarize documents using Chain of Density prompting 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/examples/chain_of_density.md`
- **Chain of thought**（project_doc）：Chain of thought is a prompting technique introduced in the paper "Chain-of-Thought Prompting Elicits Reasoning in Large Language Models" https://arxiv.org/abs/2201.11903 where throught prompting the authors generate a series of intermediate reasoning steps which improves the ability of LLMs to perform complex reasoning. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/examples/chain_of_thought.md`
- **Classification**（project_doc）：Classification is a classic problem in NLP and finds many applications: spam detection, sentiment analysis, triaging of incoming requests, etc. We will use the example of a company that wants to sort support requests between those that require immediate attention URGENT , those that can wait a little STANDARD . You could easily extend the example by adding new labels. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/examples/classification.md`
- **Generate a synthetic dating profile from a description**（project_doc）：Generate a synthetic dating profile from a description 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/examples/dating_profiles.md`
- **Run Outlines using BentoML**（project_doc）：BentoML https://github.com/bentoml/BentoML is an open-source model serving library for building performant and scalable AI applications with Python. It comes with tools that you need for serving optimization, model packaging, and production deployment. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/examples/deploy-using-bentoml.md`
- **Run Outlines using Cerebrium**（project_doc）：Cerebrium https://www.cerebrium.ai/ is a serverless AI infrastructure platform that makes it easier for companies to build and deploy AI based applications. They offer Serverless GPU's with low cold start times with over 12 varieties of GPU chips that auto scale and you only pay for the compute you use. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/examples/deploy-using-cerebrium.md`
- **Run Outlines using Modal**（project_doc）：Modal https://modal.com/ is a serverless platform that allows you to easily run code on the cloud, including GPUs. It can come very handy for those of us who don't have a monster GPU at home and want to be able to quickly and easily provision, configure and orchestrate cloud infrastructure. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/examples/deploy-using-modal.md`
- **Extracting financial data from earnings reports**（project_doc）：Extracting financial data from earnings reports 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/examples/earnings-reports.md`
- **Extract Event Details**（project_doc）：This recipe demonstrates how to use the outlines library to extract structured event details from a text message. We will extract the title, location, and start date and time from messages like the following: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/examples/extract_event_details.md`
- **Named entity extraction**（project_doc）：Named Entity Extraction is a fundamental problem in NLP. It involves identifying and categorizing named entities within a document: people, organization, dates, places, etc. It is usually the first step in a more complex NLP worklow. Here we will use the example of a pizza restaurant that receives orders via their website and need to identify the number and types of pizzas that are being ordered. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/examples/extraction.md`
- **Examples**（project_doc）：This part of the documentation provides a few cookbooks that you can browse to get acquainted with the library and get some inspiration about what you could do with structured generation. Remember that you can easily change the model that is being used! 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/examples/index.md`
- **Knowledge Graph Extraction**（project_doc）：In this guide, we use outlines https://dottxt-ai.github.io/outlines/ to extract a knowledge graph from unstructured text. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/examples/knowledge_graph_extraction.md`
- **Large language models playing chess**（project_doc）：Large language models playing chess 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/examples/models_playing_chess.md`
- **Generate Synthetic Data and Q&A with Citations**（project_doc）：Generate Synthetic Data and Q&A with Citations 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/examples/qa-with-citations.md`
- **ReAct Agent**（project_doc）：This example shows how to use outlines https://dottxt-ai.github.io/outlines/ to build your own agent with open weights local models and structured outputs. It is inspired by the blog post A simple Python implementation of the ReAct pattern for LLMs https://til.simonwillison.net/llms/python-react-pattern by Simon Willison https://simonwillison.net/ . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/examples/react_agent.md`
- **PDF to structured output with vision language models**（project_doc）：PDF to structured output with vision language models 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/examples/read-pdfs.md`
- **Receipt Data Extraction with VLMs**（project_doc）：You'll need to install the dependencies: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/examples/receipt-digitization.md`
- **Build perspective-taking agents with SimToM**（project_doc）：Build perspective-taking agents with SimToM 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/examples/simtom.md`
- **Structured Generation Workflow: Generating Synthetic Phone Numbers**（project_doc）：Structured Generation Workflow: Generating Synthetic Phone Numbers 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/examples/structured_generation_workflow.md`
- **Structured Generation Backends**（project_doc）：Outlines relies on a structured generation backend to control text generation for steerable models such thah they conform to the output type provided. One of those backends is of course outlines-core , but you also have access to two other libraries that fulfill the same purpose: llguidance and xgrammar . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/features/advanced/backends.md`
- **Logits Processors**（project_doc）：Logits processors are objects that control text generation by modifying the probability distribution of possible next tokens. They do this by adjusting the logits raw model outputs at each generation step, effectively biasing the model's token selection. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/features/advanced/logits_processors.md`
- **Error Handling**（project_doc）：For server-based models, Outlines provides a common exception hierarchy under OutlinesError . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/features/core/exceptions.md`
- **Generator**（project_doc）：The Generator class is the core component of Outlines v1. Generator accepts a model ../models/index.md and an optional output type ../core/output types.md . If no output type is provided, the Generator will return unstructured text. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/features/core/generator.md`
- **Model Inputs**（project_doc）：Outlines models accept various types of inputs to generate text. The input format depends on the capabilities of the underlying model and the type of task you want to perform. The most basic type of input is a single string prompt, it's accepted by all models. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/features/core/inputs.md`
- **Output Types**（project_doc）：Outlines provides a simple and intuitive way of defining the output structure of text generation. Possible output formats include basic Python types, multiple-choices, JSON schemas, regular expressions and context-free grammars. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/features/core/output_types.md`
- **Features**（project_doc）：This section presents in details the different features of Outlines. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/features/index.md`
- **Anthropic**（project_doc）：You need to install the anthropic library to be able to use the Anthropic API in Outlines. Install all optional dependencies of the Anthropic model with: pip install "outlines anthropic " . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/features/models/anthropic.md`
- **Dottxt**（project_doc）：You need to install the dottxt python sdk to be able to use the Dottxt API in Outlines. Install all optional dependencies of the Dottxt model with: pip install "outlines dottxt " . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/features/models/dottxt.md`
- **Models**（project_doc）：Outlines models are objects that wrap an inference client or engine. Models provide a standardized interface to generate structured text. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/features/models/index.md`
- **llama.cpp**（project_doc）：Outlines provides an integration with Llama.cpp https://github.com/ggerganov/llama.cpp using the llama-cpp-python library https://github.com/abetlen/llama-cpp-python . Llamacpp allows to run quantized models on machines with limited compute. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/features/models/llamacpp.md`
- **Mistral**（project_doc）：You need to install the mistralai library to be able to use the Mistral API in Outlines. Install all optional dependencies of the Mistral model with: pip install "outlines mistral " . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/features/models/mistral.md`
- **mlx-lm**（project_doc）：Outlines provides an integration with mlx-lm https://github.com/ml-explore/mlx-examples/tree/main/llms , allowing models to be run quickly on Apple Silicon via the mlx https://ml-explore.github.io/mlx/build/html/index.html library. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/features/models/mlxlm.md`
- **Ollama**（project_doc）：To be able to use Ollama in Outlines, you must install both Ollama and the optional dependency libraries of the model. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/features/models/ollama.md`
- **OpenAI**（project_doc）：You need to install the openai library to be able to use the OpenAI API in Outlines. Install all optional dependencies of the OpenAI model with: pip install "outlines openai " . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/features/models/openai.md`
- **OpenAI-Compatible APIs**（project_doc）：Many inference providers offer OpenAI-compatible APIs, allowing you to use the familiar OpenAI SDK while connecting to different backends. Outlines allows you can leverage various providers while maintaining consistent code. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/features/models/openai_compatible.md`
- **Openrouter**（project_doc）：OpenRouter https://openrouter.ai/docs/api-reference/overview uses the same API as OpenAI, so both services are interoperable ./openai compatible.md using the openai library. Install all optional dependencies of the OpenAI model with: pip install "outlines openai " . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/features/models/openrouter.md`
- **SGLang**（project_doc）：The Outlines SGLang model is intended to be used along with an SGLang instance running on a separate server can be local or remote . Make sure you have a SGLang server running and accessible before using the SGLang model. For instance by running: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/features/models/sglang.md`
- **TGI**（project_doc）：The Outlines TGI model is intended to be used along with a HuggingFace Text Generation Inference server running locally or remotely . Make sure you have a TGI server running before using the TGI model. For instance running: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/features/models/tgi.md`
- **Transformers**（project_doc）：You need to install the transformers library to be able to use the Transformers in Outlines. Install all optional dependencies of the Transformers model with: pip install "outlines transformers " . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/features/models/transformers.md`
- **Transformers MultiModal**（project_doc）：The Outlines TransformersMultiModal model inherits from Transformers and shares most of its interface. Please start by reading the Transformers documentation ./transformers.md as this document only focuses on the specificities of TransformersMultiModal compared to Transformers . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/features/models/transformers_multimodal.md`
- **vLLM**（project_doc）：The Outlines VLLM model is intended to be used along with a vLLM instance running on a separate server can be local or remote . Make sure you have a vLLM server running and accessible before using the VLLM model. For instance by running: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/features/models/vllm.md`
- **vLLM Offline**（project_doc）：Outlines provides an integration with vLLM https://docs.vllm.ai/en/latest/ using the vllm library https://github.com/vllm-project/vllm . This model allows you to use vLLM in the "Offline Inference" mode, meaning that text generation happens within the model, there is no separate server. If you want to use vLLM with a server, see the VLLM model documentation ./vllm.md . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/features/models/vllm_offline.md`
- **Application**（project_doc）：The Application class enables you to encapsulate a prompt template and an output type into a reusable component. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/features/utility/application.md`
- **Regex DSL**（project_doc）：This library provides a Domain-Specific Language DSL to construct regular expressions in a more intuitive and modular way. It allows you to create complex regexes using simple building blocks that represent literal strings, patterns, and various quantifiers. Additionally, these custom regex types can be used directly as types in Pydantic https://pydantic-docs.helpmanual.io/ schemas to enforce pattern constraints dur… 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/features/utility/regex_dsl.md`
- **Template**（project_doc）：Outlines templates provide a way of creating reusable prompt structures with placeholders for dynamic content. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/features/utility/template.md`
- **Architecture Overview**（project_doc）：This guide explains how Outlines is organized so you can navigate the codebase, debug issues, and extend the library. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/guide/architecture.md`
- **Chat templating**（project_doc）：Instruction-tuned language models use "special tokens" to indicate different parts of text, such as the system prompt, the user prompt, any images, and the assistant's response. A chat template https://huggingface.co/docs/transformers/main/en/chat templating is how different types of input are composited together into a single, machine-readable string. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/guide/chat_templating.md`
- **Core concepts**（project_doc）：Coming soon. This will document various concepts at a high level, so users can understand Outlines before diving into specific implementations. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/guide/core_concepts.md`
- **Deploying with FastAPI**（project_doc）：This guide demonstrates how to build a FastAPI application that leverages Outlines' async integration with vLLM. We create a customer support API that can intelligently categorize tickets and generate structured responses. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/guide/fastapi_vllm_deployment.md`
- **Getting Started**（project_doc）：We recommend using uv to install Outlines. You can find uv installation instructions here https://github.com/astral-sh/uv . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/guide/getting_started.md`
- **Installation**（project_doc）：We recommend using modern Python packaging tools such as uv for managing python dependencies. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/guide/installation.md`
- **Outlines 1.0 migration guide**（project_doc）：Outlines 1.0 introduces some breaking changes that affect the way you use the library. You are likely concerned by all of the following sections, so please read this document carefully until the end. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/guide/migration.md`
- **Models**（project_doc）：This guide should provide a general overview of the available models in the API reference /api/models/ . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/guide/selecting_an_inference_backend.md`
- **Vision-Language Models with Outlines**（project_doc）：Vision-Language Models with Outlines 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/guide/vlm.md`
- **Release Note**（project_doc）：The v1 intends on making Outlines more closely focused on constrained generation. To do so, we delegate a wider range of tasks to the users and inference libraries. On top of making Outlines leaner, this design provides more flexibility to the users and let them use interfaces they are already familiar with. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`outlines/release_note.md`
- **🚧 Thank you for opening a PR!**（project_doc）：A few important guidelines and requirements before we can merge your PR: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`.github/PULL_REQUEST_TEMPLATE/pull_request_template.md`

## 证据索引

- 共索引 80 条证据。

- **Gemini**（documentation）：You need to install the google.genai libray to be able to use the Gemini API in Outlines. Install all optional dependencies of the Gemini model with: pip install "outlines gemini " . 证据：`docs/features/models/gemini.md`
- **🚀 Building the future of structured generation**（documentation）：Made with ❤👷️ by the team at .txt https://dottxt.co Trusted by NVIDIA, Cohere, HuggingFace, vLLM, etc. 证据：`README.md`
- **Deploy Outlines on Beam**（documentation）：1. Create an account here https://beam.cloud and install the Beam SDK 2. Download the app.py file to your computer 3. Deploy it as a serverless API by running: beam deploy app.py:predict 证据：`examples/beam-cloud/README.md`
- **License**（source_file）：Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ 证据：`LICENSE`
- **Core concepts**（documentation）：Coming soon. This will document various concepts at a high level, so users can understand Outlines before diving into specific implementations. 证据：`docs/core_concepts.md`
- **Index**（documentation）：! assets/images/logo-light-mode.svg only-light { width="500" } ! assets/images/logo-dark-mode.svg only-dark { width="500" } 证据：`docs/index.md`
- **API Reference**（documentation）：API Reference 证据：`docs/api_reference/index.md`
- **Blog**（documentation）：Blog 证据：`docs/blog/index.md`
- **What contributions?**（documentation）：- Documentation contributions are very valuable to us! - Examples. Show us what you did with Outlines : - Bug reports with a minimum working examples in the issue tracker issues - Bug fixes are always a pleasure to review. - New features . Please start a new discussion discussions , or come chat with us discord beforehand! 证据：`docs/community/contribute.md`
- **Community projects and articles**（documentation）：Publishing examples and articles about Outlines are a meaningful way to contribute to the community. Here is a list of projects we are aware of. Drop us a line if we forgot yours! 证据：`docs/community/examples.md`
- **Feedback**（documentation）：If Outlines has been helpful to you, let us know on Discord discord or give us a shoutout on Twitter twitter ! It's always heartwarming ❤️ 证据：`docs/community/feedback.md`
- **Community**（documentation）：Outlines exists for a community of users who believe software doesn't need to be complicated. Who share the same passion for Large Language Models but don't want to compromise on robustness. Together, we are bringing these powerful models back to the world of software. 证据：`docs/community/index.md`
- **Versioning Guide**（documentation）：The Outlines project follows a structured versioning scheme designed to provide clarity and minimize risk for downstream dependents. 证据：`docs/community/versioning.md`
- **Summarize documents using Chain of Density prompting**（documentation）：Summarize documents using Chain of Density prompting 证据：`docs/examples/chain_of_density.md`
- **Chain of thought**（documentation）：Chain of thought is a prompting technique introduced in the paper "Chain-of-Thought Prompting Elicits Reasoning in Large Language Models" https://arxiv.org/abs/2201.11903 where throught prompting the authors generate a series of intermediate reasoning steps which improves the ability of LLMs to perform complex reasoning. 证据：`docs/examples/chain_of_thought.md`
- **Classification**（documentation）：Classification is a classic problem in NLP and finds many applications: spam detection, sentiment analysis, triaging of incoming requests, etc. We will use the example of a company that wants to sort support requests between those that require immediate attention URGENT , those that can wait a little STANDARD . You could easily extend the example by adding new labels. 证据：`docs/examples/classification.md`
- **Generate a synthetic dating profile from a description**（documentation）：Generate a synthetic dating profile from a description 证据：`docs/examples/dating_profiles.md`
- **Run Outlines using BentoML**（documentation）：BentoML https://github.com/bentoml/BentoML is an open-source model serving library for building performant and scalable AI applications with Python. It comes with tools that you need for serving optimization, model packaging, and production deployment. 证据：`docs/examples/deploy-using-bentoml.md`
- **Run Outlines using Cerebrium**（documentation）：Cerebrium https://www.cerebrium.ai/ is a serverless AI infrastructure platform that makes it easier for companies to build and deploy AI based applications. They offer Serverless GPU's with low cold start times with over 12 varieties of GPU chips that auto scale and you only pay for the compute you use. 证据：`docs/examples/deploy-using-cerebrium.md`
- **Run Outlines using Modal**（documentation）：Modal https://modal.com/ is a serverless platform that allows you to easily run code on the cloud, including GPUs. It can come very handy for those of us who don't have a monster GPU at home and want to be able to quickly and easily provision, configure and orchestrate cloud infrastructure. 证据：`docs/examples/deploy-using-modal.md`
- **Extracting financial data from earnings reports**（documentation）：Extracting financial data from earnings reports 证据：`docs/examples/earnings-reports.md`
- **Extract Event Details**（documentation）：This recipe demonstrates how to use the outlines library to extract structured event details from a text message. We will extract the title, location, and start date and time from messages like the following: 证据：`docs/examples/extract_event_details.md`
- **Named entity extraction**（documentation）：Named Entity Extraction is a fundamental problem in NLP. It involves identifying and categorizing named entities within a document: people, organization, dates, places, etc. It is usually the first step in a more complex NLP worklow. Here we will use the example of a pizza restaurant that receives orders via their website and need to identify the number and types of pizzas that are being ordered. 证据：`docs/examples/extraction.md`
- **Examples**（documentation）：This part of the documentation provides a few cookbooks that you can browse to get acquainted with the library and get some inspiration about what you could do with structured generation. Remember that you can easily change the model that is being used! 证据：`docs/examples/index.md`
- **Knowledge Graph Extraction**（documentation）：In this guide, we use outlines https://dottxt-ai.github.io/outlines/ to extract a knowledge graph from unstructured text. 证据：`docs/examples/knowledge_graph_extraction.md`
- **Large language models playing chess**（documentation）：Large language models playing chess 证据：`docs/examples/models_playing_chess.md`
- **Generate Synthetic Data and Q&A with Citations**（documentation）：Generate Synthetic Data and Q&A with Citations 证据：`docs/examples/qa-with-citations.md`
- **ReAct Agent**（documentation）：This example shows how to use outlines https://dottxt-ai.github.io/outlines/ to build your own agent with open weights local models and structured outputs. It is inspired by the blog post A simple Python implementation of the ReAct pattern for LLMs https://til.simonwillison.net/llms/python-react-pattern by Simon Willison https://simonwillison.net/ . 证据：`docs/examples/react_agent.md`
- **PDF to structured output with vision language models**（documentation）：PDF to structured output with vision language models 证据：`docs/examples/read-pdfs.md`
- **Receipt Data Extraction with VLMs**（documentation）：You'll need to install the dependencies: 证据：`docs/examples/receipt-digitization.md`
- **Build perspective-taking agents with SimToM**（documentation）：Build perspective-taking agents with SimToM 证据：`docs/examples/simtom.md`
- **Structured Generation Workflow: Generating Synthetic Phone Numbers**（documentation）：Structured Generation Workflow: Generating Synthetic Phone Numbers 证据：`docs/examples/structured_generation_workflow.md`
- **Structured Generation Backends**（documentation）：Outlines relies on a structured generation backend to control text generation for steerable models such thah they conform to the output type provided. One of those backends is of course outlines-core , but you also have access to two other libraries that fulfill the same purpose: llguidance and xgrammar . 证据：`docs/features/advanced/backends.md`
- **Logits Processors**（documentation）：Logits processors are objects that control text generation by modifying the probability distribution of possible next tokens. They do this by adjusting the logits raw model outputs at each generation step, effectively biasing the model's token selection. 证据：`docs/features/advanced/logits_processors.md`
- **Error Handling**（documentation）：For server-based models, Outlines provides a common exception hierarchy under OutlinesError . 证据：`docs/features/core/exceptions.md`
- **Generator**（documentation）：The Generator class is the core component of Outlines v1. Generator accepts a model ../models/index.md and an optional output type ../core/output types.md . If no output type is provided, the Generator will return unstructured text. 证据：`docs/features/core/generator.md`
- **Model Inputs**（documentation）：Outlines models accept various types of inputs to generate text. The input format depends on the capabilities of the underlying model and the type of task you want to perform. The most basic type of input is a single string prompt, it's accepted by all models. 证据：`docs/features/core/inputs.md`
- **Output Types**（documentation）：Outlines provides a simple and intuitive way of defining the output structure of text generation. Possible output formats include basic Python types, multiple-choices, JSON schemas, regular expressions and context-free grammars. 证据：`docs/features/core/output_types.md`
- **Features**（documentation）：This section presents in details the different features of Outlines. 证据：`docs/features/index.md`
- **Anthropic**（documentation）：You need to install the anthropic library to be able to use the Anthropic API in Outlines. Install all optional dependencies of the Anthropic model with: pip install "outlines anthropic " . 证据：`docs/features/models/anthropic.md`
- **Dottxt**（documentation）：You need to install the dottxt python sdk to be able to use the Dottxt API in Outlines. Install all optional dependencies of the Dottxt model with: pip install "outlines dottxt " . 证据：`docs/features/models/dottxt.md`
- **Models**（documentation）：Outlines models are objects that wrap an inference client or engine. Models provide a standardized interface to generate structured text. 证据：`docs/features/models/index.md`
- **llama.cpp**（documentation）：Outlines provides an integration with Llama.cpp https://github.com/ggerganov/llama.cpp using the llama-cpp-python library https://github.com/abetlen/llama-cpp-python . Llamacpp allows to run quantized models on machines with limited compute. 证据：`docs/features/models/llamacpp.md`
- **Mistral**（documentation）：You need to install the mistralai library to be able to use the Mistral API in Outlines. Install all optional dependencies of the Mistral model with: pip install "outlines mistral " . 证据：`docs/features/models/mistral.md`
- **mlx-lm**（documentation）：Outlines provides an integration with mlx-lm https://github.com/ml-explore/mlx-examples/tree/main/llms , allowing models to be run quickly on Apple Silicon via the mlx https://ml-explore.github.io/mlx/build/html/index.html library. 证据：`docs/features/models/mlxlm.md`
- **Ollama**（documentation）：To be able to use Ollama in Outlines, you must install both Ollama and the optional dependency libraries of the model. 证据：`docs/features/models/ollama.md`
- **OpenAI**（documentation）：You need to install the openai library to be able to use the OpenAI API in Outlines. Install all optional dependencies of the OpenAI model with: pip install "outlines openai " . 证据：`docs/features/models/openai.md`
- **OpenAI-Compatible APIs**（documentation）：Many inference providers offer OpenAI-compatible APIs, allowing you to use the familiar OpenAI SDK while connecting to different backends. Outlines allows you can leverage various providers while maintaining consistent code. 证据：`docs/features/models/openai_compatible.md`
- **Openrouter**（documentation）：OpenRouter https://openrouter.ai/docs/api-reference/overview uses the same API as OpenAI, so both services are interoperable ./openai compatible.md using the openai library. Install all optional dependencies of the OpenAI model with: pip install "outlines openai " . 证据：`docs/features/models/openrouter.md`
- **SGLang**（documentation）：The Outlines SGLang model is intended to be used along with an SGLang instance running on a separate server can be local or remote . Make sure you have a SGLang server running and accessible before using the SGLang model. For instance by running: 证据：`docs/features/models/sglang.md`
- **TGI**（documentation）：The Outlines TGI model is intended to be used along with a HuggingFace Text Generation Inference server running locally or remotely . Make sure you have a TGI server running before using the TGI model. For instance running: 证据：`docs/features/models/tgi.md`
- **Transformers**（documentation）：You need to install the transformers library to be able to use the Transformers in Outlines. Install all optional dependencies of the Transformers model with: pip install "outlines transformers " . 证据：`docs/features/models/transformers.md`
- **Transformers MultiModal**（documentation）：The Outlines TransformersMultiModal model inherits from Transformers and shares most of its interface. Please start by reading the Transformers documentation ./transformers.md as this document only focuses on the specificities of TransformersMultiModal compared to Transformers . 证据：`docs/features/models/transformers_multimodal.md`
- **vLLM**（documentation）：The Outlines VLLM model is intended to be used along with a vLLM instance running on a separate server can be local or remote . Make sure you have a vLLM server running and accessible before using the VLLM model. For instance by running: 证据：`docs/features/models/vllm.md`
- **vLLM Offline**（documentation）：Outlines provides an integration with vLLM https://docs.vllm.ai/en/latest/ using the vllm library https://github.com/vllm-project/vllm . This model allows you to use vLLM in the "Offline Inference" mode, meaning that text generation happens within the model, there is no separate server. If you want to use vLLM with a server, see the VLLM model documentation ./vllm.md . 证据：`docs/features/models/vllm_offline.md`
- **Application**（documentation）：The Application class enables you to encapsulate a prompt template and an output type into a reusable component. 证据：`docs/features/utility/application.md`
- **Regex DSL**（documentation）：This library provides a Domain-Specific Language DSL to construct regular expressions in a more intuitive and modular way. It allows you to create complex regexes using simple building blocks that represent literal strings, patterns, and various quantifiers. Additionally, these custom regex types can be used directly as types in Pydantic https://pydantic-docs.helpmanual.io/ schemas to enforce pattern constraints during text generation. 证据：`docs/features/utility/regex_dsl.md`
- **Template**（documentation）：Outlines templates provide a way of creating reusable prompt structures with placeholders for dynamic content. 证据：`docs/features/utility/template.md`
- **Architecture Overview**（documentation）：This guide explains how Outlines is organized so you can navigate the codebase, debug issues, and extend the library. 证据：`docs/guide/architecture.md`
- **Chat templating**（documentation）：Instruction-tuned language models use "special tokens" to indicate different parts of text, such as the system prompt, the user prompt, any images, and the assistant's response. A chat template https://huggingface.co/docs/transformers/main/en/chat templating is how different types of input are composited together into a single, machine-readable string. 证据：`docs/guide/chat_templating.md`
- 其余 20 条证据见 `AI_CONTEXT_PACK.json` 或 `EVIDENCE_INDEX.json`。

## 宿主 AI 必须遵守的规则

- **把本资产当作开工前上下文，而不是运行环境。**：AI Context Pack 只包含证据化项目理解，不包含目标项目的可执行状态。 证据：`docs/features/models/gemini.md`, `README.md`, `examples/beam-cloud/README.md`
- **回答用户时区分可预览内容与必须安装后才能验证的内容。**：安装前体验的消费者价值来自降低误装和误判，而不是伪装成真实运行。 证据：`docs/features/models/gemini.md`, `README.md`, `examples/beam-cloud/README.md`

## 用户开工前应该回答的问题

- 你准备在哪个宿主 AI 或本地环境中使用它？
- 你只是想先体验工作流，还是准备真实安装？
- 你最在意的是安装成本、输出质量、还是和现有规则的冲突？

## 验收标准

- 所有能力声明都能回指到 evidence_refs 中的文件路径。
- AI_CONTEXT_PACK.md 没有把预览包装成真实运行。
- 用户能在 3 分钟内看懂适合谁、能做什么、如何开始和风险边界。

---

## Doramagic Context Augmentation

下面内容用于强化 Repomix/AI Context Pack 主体。Human Manual 只提供阅读骨架；踩坑日志会被转成宿主 AI 必须遵守的工作约束。

## Human Manual 骨架

使用规则：这里只是项目阅读路线和显著性信号，不是事实权威。具体事实仍必须回到 repo evidence / Claim Graph。

宿主 AI 硬性规则：
- 不得把页标题、章节顺序、摘要或 importance 当作项目事实证据。
- 解释 Human Manual 骨架时，必须明确说它只是阅读路线/显著性信号。
- 能力、安装、兼容性、运行状态和风险判断必须引用 repo evidence、source path 或 Claim Graph。

- **Outlines 简介**：importance `high`
  - source_paths: README.md, outlines/release_note.md
- **安装指南**：importance `high`
  - source_paths: pyproject.toml, environment.yml
- **快速开始**：importance `high`
  - source_paths: README.md, examples/dating_profile.py, examples/react.py
- **系统架构**：importance `high`
  - source_paths: outlines/generator.py, outlines/backends/__init__.py, outlines/processors/__init__.py, llm.txt
- **核心概念**：importance `high`
  - source_paths: llm.txt, outlines/backends/base.py
- **输出类型**：importance `high`
  - source_paths: outlines/types/dsl.py, outlines/types/json_schema_utils.py, outlines/types/utils.py
- **类型系统**：importance `medium`
  - source_paths: outlines/types/dsl.py, outlines/types/__init__.py, outlines/grammars/json.lark
- **模型提供者**：importance `high`
  - source_paths: outlines/models/__init__.py, outlines/models/base.py, outlines/models/transformers.py, outlines/models/openai.py, outlines/models/vllm.py

## Repo Inspection Evidence / 源码检查证据

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `6ae21356fd0dda00afd0ef0e76752904a22fc0aa`
- inspected_files: `pyproject.toml`, `README.md`, `uv.lock`, `docs/index.md`, `docs/core_concepts.md`, `docs/blog/index.md`, `docs/community/index.md`, `docs/community/versioning.md`, `docs/community/contribute.md`, `docs/community/examples.md`, `docs/community/feedback.md`, `docs/guide/architecture.md`, `docs/guide/fastapi_vllm_deployment.md`, `docs/guide/getting_started.md`, `docs/guide/vlm.md`, `docs/guide/installation.md`, `docs/guide/chat_templating.md`, `docs/guide/core_concepts.md`, `docs/guide/migration.md`, `docs/guide/selecting_an_inference_backend.md`

宿主 AI 硬性规则：
- 没有 repo_clone_verified=true 时，不得声称已经读过源码。
- 没有 repo_inspection_verified=true 时，不得把 README/docs/package 文件判断写成事实。
- 没有 quick_start_verified=true 时，不得声称 Quick Start 已跑通。

## Doramagic Pitfall Constraints / 踩坑约束

这些规则来自 Doramagic 发现、验证或编译过程中的项目专属坑点。宿主 AI 必须把它们当作工作约束，而不是普通说明文字。

### Constraint 1: 来源证据：[Feature] Streaming structured generation with partial validation

- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：[Feature] Streaming structured generation with partial validation
- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | cevd_dc85cb063a664cf28645f478ac7de3e4 | https://github.com/dottxt-ai/outlines/issues/1856 | 来源类型 github_issue 暴露的待验证使用条件。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 2: 来源证据：📝 Integration Proposal: CAJAL — Structured Scientific Paper Generation

- Trigger: GitHub 社区证据显示该项目存在一个配置相关的待验证问题：📝 Integration Proposal: CAJAL — Structured Scientific Paper Generation
- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | cevd_275e7b7e47ef449aa9f5aebb987eaf63 | https://github.com/dottxt-ai/outlines/issues/1859 | 来源讨论提到 python 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 3: 来源证据：Add more custom types

- Trigger: GitHub 社区证据显示该项目存在一个维护/版本相关的待验证问题：Add more custom types
- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | cevd_e9b8049cf33648f59be1398a828cfd91 | https://github.com/dottxt-ai/outlines/issues/1303 | 来源类型 github_issue 暴露的待验证使用条件。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 4: 来源证据：Add function calling and MCP support

- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Add function calling and MCP support
- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- Why it matters: 可能影响授权、密钥配置或安全边界。
- Evidence: community_evidence:github | cevd_cc2063bf4a764510890d6ab8b2218e10 | https://github.com/dottxt-ai/outlines/issues/1626 | 来源讨论提到 python 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 5: 来源证据：[Feature Request] Add streaming support for structured generation

- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：[Feature Request] Add streaming support for structured generation
- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- Why it matters: 可能影响授权、密钥配置或安全边界。
- Evidence: community_evidence:github | cevd_0a0ce1410e93475594f5dafc93f9613a | https://github.com/dottxt-ai/outlines/issues/1842 | 来源讨论提到 python 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 6: 失败模式：installation: Incompatibility with vllm==0.19 because of some api changes

- Trigger: Developers should check this installation risk before relying on the project: Incompatibility with vllm==0.19 because of some api changes
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: Incompatibility with vllm==0.19 because of some api changes. Context: Observed when using python, cuda
- Why it matters: Developers may fail before the first successful local run: Incompatibility with vllm==0.19 because of some api changes
- Evidence: failure_mode_cluster:github_issue | fmev_9f23e49bc91e3f8af003ddcdedec3e72 | https://github.com/dottxt-ai/outlines/issues/1854 | Incompatibility with vllm==0.19 because of some api changes
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 7: 失败模式：installation: Outlines v1.2.6

- Trigger: Developers should check this installation risk before relying on the project: Outlines v1.2.6
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: Outlines v1.2.6. Context: Observed during installation or first-run setup.
- Why it matters: Upgrade or migration may change expected behavior: Outlines v1.2.6
- Evidence: failure_mode_cluster:github_release | fmev_e917f6640a48bc54b76cbbbfcfd2b346 | https://github.com/dottxt-ai/outlines/releases/tag/1.2.6 | Outlines v1.2.6
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 8: 失败模式：installation: Outlines v1.2.8

- Trigger: Developers should check this installation risk before relying on the project: Outlines v1.2.8
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: Outlines v1.2.8. Context: Observed when using python
- Why it matters: Upgrade or migration may change expected behavior: Outlines v1.2.8
- Evidence: failure_mode_cluster:github_release | fmev_802eb50b3a54cd87f585ac14e899b4bc | https://github.com/dottxt-ai/outlines/releases/tag/1.2.8 | Outlines v1.2.8
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 9: 来源证据：Feature request: OWASP ASI06 memory poisoning defense for structured generation

- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Feature request: OWASP ASI06 memory poisoning defense for structured generation
- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | cevd_5fe257116a4b481dbd938b2c0d9ad949 | https://github.com/dottxt-ai/outlines/issues/1864 | 来源类型 github_issue 暴露的待验证使用条件。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 10: 能力判断依赖假设

- Trigger: README/documentation is current enough for a first validation pass.
- Host AI rule: 将假设转成下游验证清单。
- Why it matters: 假设不成立时，用户拿不到承诺的能力。
- Evidence: capability.assumptions | github_repo:615403340 | https://github.com/dottxt-ai/outlines | README/documentation is current enough for a first validation pass.
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。
