[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M758RCCMEF4D6ZPV7F56ARBE":3,"skill-same:01M758RCCMEF4D6ZPV7F56ARBE":70},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":47,"commitSha":48,"skillDirectory":49,"forksCount":50,"repositoryHtmlUrl":51,"repositoryHomepageUrl":52,"ownerHtmlUrl":53,"ownerBlogUrl":6,"ownerDescription":54,"updatedAt":55,"install":56,"resources":69},"01M758RCCMEF4D6ZPV7F56ARBE","outlines",null,"Outlines: structured JSON\u002Fregex\u002FPydantic LLM generation.","lukemcqueen\u002Fsteadfaste-fleet","lukemcqueen","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F405240?v=4","01M757MHPAGRXTJAT46SKZP98R","Luke McQueen","01M757MHPZ573KP8DT9GB8SBQ7",4,"MIT","https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fmlops\u002Finference\u002Foutlines\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: outlines\ndescription: \"Outlines: structured JSON\u002Fregex\u002FPydantic LLM generation.\"\nversion: 1.0.1\nauthor: Orchestra Research\nlicense: MIT\ndependencies: [outlines, transformers, vllm, pydantic]\nplatforms: [linux, macos, windows]\nmetadata:\n  hermes:\n    tags: [Prompt Engineering, Outlines, Structured Generation, JSON Schema, Pydantic, Local Models, Grammar-Based Generation, vLLM, Transformers, Type Safety]\n\n---\n\n# Outlines: Structured Text Generation\n\n## When to Use This Skill\n\nUse Outlines when you need to:\n- **Guarantee valid JSON\u002FXML\u002Fcode** structure during generation\n- **Use Pydantic models** for type-safe outputs\n- **Support local models** (Transformers, llama.cpp, vLLM)\n- **Maximize inference speed** with zero-overhead structured generation\n- **Generate against JSON schemas** automatically\n- **Control token sampling** at the grammar level\n\n**GitHub Stars**: 12,000+ | **From**: dottxt.ai (formerly .txt)\n\n> **API note (Outlines 1.x):** This skill targets the current v1 API.\n> The pre-1.0 helpers (`outlines.models.transformers(...)`,\n> `outlines.generate.json\u002Fchoice\u002Fregex\u002F...`) have been **removed**. In v1 you\n> create a model with `outlines.from_transformers(...)` (or `from_vllm`,\n> `from_llamacpp`, `from_openai`) and then **call the model directly** with an\n> output type: `model(prompt, output_type)`. JSON\u002FPydantic outputs are returned\n> as a **JSON string** — validate with `YourModel.model_validate_json(result)`.\n\n## Installation\n\n```bash\n# Base installation\npip install outlines\n\n# With specific backends\npip install outlines transformers  # Hugging Face models\npip install outlines llama-cpp-python  # llama.cpp\npip install outlines vllm  # vLLM for high-throughput\n```\n\n## Quick Start\n\n### Basic Example: Classification\n\n```python\nimport outlines\nfrom typing import Literal\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\n\nMODEL_NAME = \"microsoft\u002FPhi-3-mini-4k-instruct\"\n\n# v1: wrap a Transformers model + tokenizer\nmodel = outlines.from_transformers(\n    AutoModelForCausalLM.from_pretrained(MODEL_NAME, device_map=\"auto\"),\n    AutoTokenizer.from_pretrained(MODEL_NAME),\n)\n\n# Call the model directly with an output type\nprompt = \"Sentiment of 'This product is amazing!': \"\nsentiment = model(prompt, Literal[\"positive\", \"negative\", \"neutral\"])\n\nprint(sentiment)  # \"positive\" (guaranteed one of these)\n```\n\n### With Pydantic Models\n\n```python\nfrom pydantic import BaseModel\nimport outlines\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\n\nclass User(BaseModel):\n    name: str\n    age: int\n    email: str\n\nMODEL_NAME = \"microsoft\u002FPhi-3-mini-4k-instruct\"\nmodel = outlines.from_transformers(\n    AutoModelForCausalLM.from_pretrained(MODEL_NAME, device_map=\"auto\"),\n    AutoTokenizer.from_pretrained(MODEL_NAME),\n)\n\n# Generate structured output (returns a JSON string)\nprompt = \"Extract user: John Doe, 30 years old, john@example.com\"\nresult = model(prompt, User, max_new_tokens=200)\n\nuser = User.model_validate_json(result)  # parse into the Pydantic model\nprint(user.name)   # \"John Doe\"\nprint(user.age)    # 30\nprint(user.email)  # \"john@example.com\"\n```\n\n## Core Concepts\n\n### 1. Constrained Token Sampling\n\nOutlines constrains token generation at the logit level using a compiled\nautomaton derived from your output type.\n\n**How it works:**\n1. Convert the output type (JSON\u002FPydantic\u002Fregex\u002F`Literal`) to a schema\u002Fgrammar\n2. Compile the grammar into a token-level automaton\n3. Filter invalid tokens at each step during generation\n4. Fast-forward when only one valid token exists\n\n**Benefits:**\n- **Zero overhead**: Filtering happens at token level\n- **Speed improvement**: Fast-forward through deterministic paths\n- **Guaranteed validity**: Invalid outputs impossible\n\n```python\nimport outlines\nfrom pydantic import BaseModel\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\n\nclass Person(BaseModel):\n    name: str\n    age: int\n\nmodel = outlines.from_transformers(\n    AutoModelForCausalLM.from_pretrained(\"microsoft\u002FPhi-3-mini-4k-instruct\", device_map=\"auto\"),\n    AutoTokenizer.from_pretrained(\"microsoft\u002FPhi-3-mini-4k-instruct\"),\n)\n\nresult = model(\"Generate person: Alice, 25\", Person)\nperson = Person.model_validate_json(result)\n```\n\n### 2. Output Types\n\nIn v1 you pass the desired **output type** directly as the second argument.\n\n#### Multiple choice (`Literal`)\n\n```python\nfrom typing import Literal\n\nsentiment = model(\"Review: This is great!\", Literal[\"positive\", \"negative\", \"neutral\"])\n# Result: one of the three choices\n```\n\n#### JSON via Pydantic\n\n```python\nfrom pydantic import BaseModel\n\nclass Product(BaseModel):\n    name: str\n    price: float\n    in_stock: bool\n\nresult = model(\"Extract: iPhone 15, $999, available\", Product)\nproduct = Product.model_validate_json(result)  # valid Product instance\n```\n\n#### Regex (pass a regex string)\n\n```python\n# Generate text matching a regex pattern\nphone = model(\"Generate phone number:\", r\"[0-9]{3}-[0-9]{3}-[0-9]{4}\")\n# Result: \"555-123-4567\" (guaranteed to match the pattern)\n```\n\n#### Numeric types\n\n```python\n# Pass the Python type directly\nage = model(\"Person's age:\", int)      # guaranteed integer\nprice = model(\"Product price:\", float)  # guaranteed float\n```\n\n### 3. Model Backends\n\nOutlines supports multiple local and API-based backends via `from_*` factories.\n\n#### Transformers (Hugging Face)\n\n```python\nimport outlines\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\n\nmodel = outlines.from_transformers(\n    AutoModelForCausalLM.from_pretrained(\"microsoft\u002FPhi-3-mini-4k-instruct\", device_map=\"auto\"),\n    AutoTokenizer.from_pretrained(\"microsoft\u002FPhi-3-mini-4k-instruct\"),\n)\n\nresult = model(prompt, YourModel)\n```\n\n#### llama.cpp\n\n```python\nimport outlines\nfrom llama_cpp import Llama\n\nllm = Llama(\".\u002Fmodels\u002Fllama-3.1-8b-instruct.Q4_K_M.gguf\", n_gpu_layers=35, n_ctx=4096)\nmodel = outlines.from_llamacpp(llm)\n\nresult = model(prompt, YourModel)\n```\n\n#### vLLM (High Throughput)\n\n```python\nimport outlines\nfrom vllm import LLM\n\nllm = LLM(\"meta-llama\u002FLlama-3.1-8B-Instruct\", tensor_parallel_size=2)\nmodel = outlines.from_vllm(llm)\n\nresult = model(prompt, YourModel)\n```\n\n#### OpenAI (server-side constrained JSON)\n\n```python\nimport outlines\nfrom openai import OpenAI\n\nclient = OpenAI()\nmodel = outlines.from_openai(client, \"gpt-4o-mini\")\n\n# API backends support JSON-schema style structured output\nresult = model(prompt, YourModel)\n```\n\n### 4. Pydantic Integration\n\nOutlines has first-class Pydantic support with automatic schema translation.\nGeneration returns a JSON string; call `model_validate_json` to get an instance.\n\n#### Basic Models\n\n```python\nfrom pydantic import BaseModel, Field\n\nclass Article(BaseModel):\n    title: str = Field(description=\"Article title\")\n    author: str = Field(description=\"Author name\")\n    word_count: int = Field(description=\"Number of words\", gt=0)\n    tags: list[str] = Field(description=\"List of tags\")\n\nresult = model(\"Generate article about AI\", Article, max_new_tokens=300)\narticle = Article.model_validate_json(result)\nprint(article.title)\nprint(article.word_count)  # Guaranteed > 0\n```\n\n#### Nested Models\n\n```python\nclass Address(BaseModel):\n    street: str\n    city: str\n    country: str\n\nclass Person(BaseModel):\n    name: str\n    age: int\n    address: Address  # Nested model\n\nresult = model(\"Generate person in New York\", Person)\nperson = Person.model_validate_json(result)\nprint(person.address.city)  # \"New York\"\n```\n\n#### Enums and Literals\n\n```python\nfrom enum import Enum\nfrom typing import Literal\n\nclass Status(str, Enum):\n    PENDING = \"pending\"\n    APPROVED = \"approved\"\n    REJECTED = \"rejected\"\n\nclass Application(BaseModel):\n    applicant: str\n    status: Status  # Must be one of enum values\n    priority: Literal[\"low\", \"medium\", \"high\"]  # Must be one of literals\n\nresult = model(\"Generate application\", Application)\napp = Application.model_validate_json(result)\nprint(app.status)  # Status.PENDING (or APPROVED\u002FREJECTED)\n```\n\n## Common Patterns\n\n### Pattern 1: Data Extraction\n\n```python\nfrom pydantic import BaseModel\nimport outlines\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\n\nclass CompanyInfo(BaseModel):\n    name: str\n    founded_year: int\n    industry: str\n    employees: int\n\nmodel = outlines.from_transformers(\n    AutoModelForCausalLM.from_pretrained(\"microsoft\u002FPhi-3-mini-4k-instruct\", device_map=\"auto\"),\n    AutoTokenizer.from_pretrained(\"microsoft\u002FPhi-3-mini-4k-instruct\"),\n)\n\ntext = \"\"\"\nApple Inc. was founded in 1976 in the technology industry.\nThe company employs approximately 164,000 people worldwide.\n\"\"\"\n\nprompt = f\"Extract company information:\\n{text}\\n\\nCompany:\"\ncompany = CompanyInfo.model_validate_json(model(prompt, CompanyInfo, max_new_tokens=200))\n\nprint(f\"Name: {company.name}\")\nprint(f\"Founded: {company.founded_year}\")\nprint(f\"Industry: {company.industry}\")\nprint(f\"Employees: {company.employees}\")\n```\n\n### Pattern 2: Classification\n\n```python\nfrom typing import Literal\nfrom pydantic import BaseModel\n\n# Binary classification\nresult = model(\"Email: Buy now! 50% off!\", Literal[\"spam\", \"not_spam\"])\n\n# Multi-class classification\ncategory = model(\n    \"Article: Apple announces new iPhone...\",\n    Literal[\"technology\", \"business\", \"sports\", \"entertainment\"],\n)\n\n# With confidence\nclass Classification(BaseModel):\n    label: Literal[\"positive\", \"negative\", \"neutral\"]\n    confidence: float\n\nout = model(\"Review: This product is okay, nothing special\", Classification)\nresult = Classification.model_validate_json(out)\n```\n\n### Pattern 3: Structured Forms\n\n```python\nclass UserProfile(BaseModel):\n    full_name: str\n    age: int\n    email: str\n    phone: str\n    country: str\n    interests: list[str]\n\nprompt = \"\"\"\nExtract user profile from:\nName: Alice Johnson\nAge: 28\nEmail: alice@example.com\nPhone: 555-0123\nCountry: USA\nInterests: hiking, photography, cooking\n\"\"\"\n\nprofile = UserProfile.model_validate_json(model(prompt, UserProfile, max_new_tokens=250))\nprint(profile.full_name)\nprint(profile.interests)  # [\"hiking\", \"photography\", \"cooking\"]\n```\n\n### Pattern 4: Multi-Entity Extraction\n\n```python\nfrom typing import Literal\n\nclass Entity(BaseModel):\n    name: str\n    type: Literal[\"PERSON\", \"ORGANIZATION\", \"LOCATION\"]\n\nclass DocumentEntities(BaseModel):\n    entities: list[Entity]\n\ntext = \"Tim Cook met with Satya Nadella at Microsoft headquarters in Redmond.\"\nprompt = f\"Extract entities from: {text}\"\n\nresult = DocumentEntities.model_validate_json(model(prompt, DocumentEntities, max_new_tokens=300))\nfor entity in result.entities:\n    print(f\"{entity.name} ({entity.type})\")\n```\n\n### Pattern 5: Code Generation\n\n```python\nclass PythonFunction(BaseModel):\n    function_name: str\n    parameters: list[str]\n    docstring: str\n    body: str\n\nprompt = \"Generate a Python function to calculate factorial\"\nfunc = PythonFunction.model_validate_json(model(prompt, PythonFunction, max_new_tokens=300))\n\nprint(f\"def {func.function_name}({', '.join(func.parameters)}):\")\nprint(f'    \"\"\"{func.docstring}\"\"\"')\nprint(f\"    {func.body}\")\n```\n\n### Pattern 6: Batch Processing\n\n```python\nimport outlines\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\nfrom pydantic import BaseModel\n\nclass Person(BaseModel):\n    name: str\n    age: int\n\nmodel = outlines.from_transformers(\n    AutoModelForCausalLM.from_pretrained(\"microsoft\u002FPhi-3-mini-4k-instruct\", device_map=\"auto\"),\n    AutoTokenizer.from_pretrained(\"microsoft\u002FPhi-3-mini-4k-instruct\"),\n)\n\ntexts = [\n    \"John is 30 years old\",\n    \"Alice is 25 years old\",\n    \"Bob is 40 years old\",\n]\n\n# v1 accepts a list of prompts for batched generation\nprompts = [f\"Extract from: {t}\" for t in texts]\noutputs = model(prompts, Person, max_new_tokens=100)\npeople = [Person.model_validate_json(o) for o in outputs]\nfor person in people:\n    print(f\"{person.name}: {person.age}\")\n```\n\n## Backend Configuration\n\n### Transformers\n\n```python\nimport outlines\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\n\nMODEL_NAME = \"microsoft\u002FPhi-3-mini-4k-instruct\"\n\n# Basic usage\nmodel = outlines.from_transformers(\n    AutoModelForCausalLM.from_pretrained(MODEL_NAME, device_map=\"auto\"),\n    AutoTokenizer.from_pretrained(MODEL_NAME),\n)\n\n# GPU + dtype configuration is set on the HF model itself\nimport torch\nmodel = outlines.from_transformers(\n    AutoModelForCausalLM.from_pretrained(MODEL_NAME, device_map=\"cuda\", torch_dtype=torch.float16),\n    AutoTokenizer.from_pretrained(MODEL_NAME),\n)\n\n# Popular models\nfor name in [\n    \"meta-llama\u002FLlama-3.1-8B-Instruct\",\n    \"mistralai\u002FMistral-7B-Instruct-v0.3\",\n    \"Qwen\u002FQwen2.5-7B-Instruct\",\n]:\n    model = outlines.from_transformers(\n        AutoModelForCausalLM.from_pretrained(name, device_map=\"auto\"),\n        AutoTokenizer.from_pretrained(name),\n    )\n```\n\n### llama.cpp\n\n```python\nimport outlines\nfrom llama_cpp import Llama\n\n# Load GGUF model\nllm = Llama(\n    \".\u002Fmodels\u002Fllama-3.1-8b.Q4_K_M.gguf\",\n    n_ctx=4096,       # Context window\n    n_gpu_layers=35,  # GPU layers\n    n_threads=8,      # CPU threads\n)\nmodel = outlines.from_llamacpp(llm)\n\n# Full GPU offload: set n_gpu_layers=-1 on the Llama object\n```\n\n### vLLM (Production)\n\n```python\nimport outlines\nfrom vllm import LLM\n\n# Single GPU\nmodel = outlines.from_vllm(LLM(\"meta-llama\u002FLlama-3.1-8B-Instruct\"))\n\n# Multi-GPU\nmodel = outlines.from_vllm(LLM(\"meta-llama\u002FLlama-3.1-70B-Instruct\", tensor_parallel_size=4))\n\n# With quantization\nmodel = outlines.from_vllm(LLM(\"meta-llama\u002FLlama-3.1-8B-Instruct\", quantization=\"awq\"))\n```\n\n## Best Practices\n\n### 1. Use Specific Types\n\n```python\n# ✅ Good: Specific types\nclass Product(BaseModel):\n    name: str\n    price: float  # Not str\n    quantity: int  # Not str\n    in_stock: bool  # Not str\n\n# ❌ Bad: Everything as string\nclass Product(BaseModel):\n    name: str\n    price: str  # Should be float\n    quantity: str  # Should be int\n```\n\n### 2. Add Constraints\n\n```python\nfrom pydantic import Field\n\n# ✅ Good: With constraints\nclass User(BaseModel):\n    name: str = Field(min_length=1, max_length=100)\n    age: int = Field(ge=0, le=120)\n    email: str = Field(pattern=r\"^[\\w\\.-]+@[\\w\\.-]+\\.\\w+$\")\n\n# ❌ Bad: No constraints\nclass User(BaseModel):\n    name: str\n    age: int\n    email: str\n```\n\n### 3. Use Enums for Categories\n\n```python\n# ✅ Good: Enum for fixed set\nclass Priority(str, Enum):\n    LOW = \"low\"\n    MEDIUM = \"medium\"\n    HIGH = \"high\"\n\nclass Task(BaseModel):\n    title: str\n    priority: Priority\n\n# ❌ Bad: Free-form string\nclass Task(BaseModel):\n    title: str\n    priority: str  # Can be anything\n```\n\n### 4. Provide Context in Prompts\n\n```python\n# ✅ Good: Clear context\nprompt = \"\"\"\nExtract product information from the following text.\nText: iPhone 15 Pro costs $999 and is currently in stock.\nProduct:\n\"\"\"\n\n# ❌ Bad: Minimal context\nprompt = \"iPhone 15 Pro costs $999 and is currently in stock.\"\n```\n\n### 5. Handle Optional Fields\n\n```python\nfrom typing import Optional\n\n# ✅ Good: Optional fields for incomplete data\nclass Article(BaseModel):\n    title: str  # Required\n    author: Optional[str] = None  # Optional\n    date: Optional[str] = None  # Optional\n    tags: list[str] = []  # Default empty list\n\n# Can succeed even if author\u002Fdate missing\n```\n\n### 6. Always Validate JSON Output\n\n```python\n# v1 returns a JSON string for Pydantic\u002FJSON output types.\nresult = model(prompt, Article)          # str\narticle = Article.model_validate_json(result)  # Article instance\n```\n\n## Comparison to Alternatives\n\n| Feature | Outlines | Instructor | Guidance | LMQL |\n|---------|----------|------------|----------|------|\n| Pydantic Support | ✅ Native | ✅ Native | ✅ Yes | ❌ No |\n| JSON Schema | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |\n| Regex Constraints | ✅ Yes | ❌ No | ✅ Yes | ✅ Yes |\n| Local Models | ✅ Full | ⚠️ Limited | ✅ Full | ✅ Full |\n| API Models | ✅ Yes | ✅ Full | ✅ Yes | ✅ Full |\n| Zero Overhead | ✅ Yes | ❌ No | ⚠️ Partial | ✅ Yes |\n| Automatic Retrying | ❌ No | ✅ Yes | ❌ No | ❌ No |\n| Learning Curve | Low | Low | Low | High |\n\n**When to choose Outlines:**\n- Using local models (Transformers, llama.cpp, vLLM)\n- Need maximum inference speed\n- Want Pydantic model support\n- Require zero-overhead structured generation\n- Control token sampling process\n\n**When to choose alternatives:**\n- Instructor: Need API models with automatic retrying\n- Guidance: Need token healing and complex workflows\n- LMQL: Prefer declarative query syntax\n\n## Performance Characteristics\n\n**Speed:**\n- **Zero overhead**: Structured generation as fast as unconstrained\n- **Fast-forward optimization**: Skips deterministic tokens\n- **1.2-2x faster** than post-generation validation approaches\n\n**Memory:**\n- Automaton compiled once per output type (cached)\n- Minimal runtime overhead\n- Efficient with vLLM for high throughput\n\n**Accuracy:**\n- **100% valid outputs** (guaranteed by the constrained automaton)\n- No retry loops needed\n- Deterministic token filtering\n\n## Resources\n\n- **Documentation**: https:\u002F\u002Fdottxt-ai.github.io\u002Foutlines\u002F\n- **GitHub**: https:\u002F\u002Fgithub.com\u002Fdottxt-ai\u002Foutlines (12k+ stars)\n- **Discord**: https:\u002F\u002Fdiscord.gg\u002FR9DSu34mGd\n- **Blog**: https:\u002F\u002Fblog.dottxt.co\n\n## See Also\n\n- `references\u002Fjson_generation.md` - Comprehensive JSON and Pydantic patterns\n- `references\u002Fbackends.md` - Backend-specific configuration\n- `references\u002Fexamples.md` - Production-ready examples\n","# Outlines: Structured Text Generation\n\n## When to Use This Skill\n\nUse Outlines when you need to:\n- **Guarantee valid JSON\u002FXML\u002Fcode** structure during generation\n- **Use Pydantic models** for type-safe outputs\n- **Support local models** (Transformers, llama.cpp, vLLM)\n- **Maximize inference speed** with zero-overhead structured generation\n- **Generate against JSON schemas** automatically\n- **Control token sampling** at the grammar level\n\n**GitHub Stars**: 12,000+ | **From**: dottxt.ai (formerly .txt)\n\n> **API note (Outlines 1.x):** This skill targets the current v1 API.\n> The pre-1.0 helpers (`outlines.models.transformers(...)`,\n> `outlines.generate.json\u002Fchoice\u002Fregex\u002F...`) have been **removed**. In v1 you\n> create a model with `outlines.from_transformers(...)` (or `from_vllm`,\n> `from_llamacpp`, `from_openai`) and then **call the model directly** with an\n> output type: `model(prompt, output_type)`. JSON\u002FPydantic outputs are returned\n> as a **JSON string** — validate with `YourModel.model_validate_json(result)`.\n\n## Installation\n\n```bash\n# Base installation\npip install outlines\n\n# With specific backends\npip install outlines transformers  # Hugging Face models\npip install outlines llama-cpp-python  # llama.cpp\npip install outlines vllm  # vLLM for high-throughput\n```\n\n## Quick Start\n\n### Basic Example: Classification\n\n```python\nimport outlines\nfrom typing import Literal\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\n\nMODEL_NAME = \"microsoft\u002FPhi-3-mini-4k-instruct\"\n\n# v1: wrap a Transformers model + tokenizer\nmodel = outlines.from_transformers(\n    AutoModelForCausalLM.from_pretrained(MODEL_NAME, device_map=\"auto\"),\n    AutoTokenizer.from_pretrained(MODEL_NAME),\n)\n\n# Call the model directly with an output type\nprompt = \"Sentiment of 'This product is amazing!': \"\nsentiment = model(prompt, Literal[\"positive\", \"negative\", \"neutral\"])\n\nprint(sentiment)  # \"positive\" (guaranteed one of these)\n```\n\n### With Pydantic Models\n\n```python\nfrom pydantic import BaseModel\nimport outlines\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\n\nclass User(BaseModel):\n    name: str\n    age: int\n    email: str\n\nMODEL_NAME = \"microsoft\u002FPhi-3-mini-4k-instruct\"\nmodel = outlines.from_transformers(\n    AutoModelForCausalLM.from_pretrained(MODEL_NAME, device_map=\"auto\"),\n    AutoTokenizer.from_pretrained(MODEL_NAME),\n)\n\n# Generate structured output (returns a JSON string)\nprompt = \"Extract user: John Doe, 30 years old, john@example.com\"\nresult = model(prompt, User, max_new_tokens=200)\n\nuser = User.model_validate_json(result)  # parse into the Pydantic model\nprint(user.name)   # \"John Doe\"\nprint(user.age)    # 30\nprint(user.email)  # \"john@example.com\"\n```\n\n## Core Concepts\n\n### 1. Constrained Token Sampling\n\nOutlines constrains token generation at the logit level using a compiled\nautomaton derived from your output type.\n\n**How it works:**\n1. Convert the output type (JSON\u002FPydantic\u002Fregex\u002F`Literal`) to a schema\u002Fgrammar\n2. Compile the grammar into a token-level automaton\n3. Filter invalid tokens at each step during generation\n4. Fast-forward when only one valid token exists\n\n**Benefits:**\n- **Zero overhead**: Filtering happens at token level\n- **Speed improvement**: Fast-forward through deterministic paths\n- **Guaranteed validity**: Invalid outputs impossible\n\n```python\nimport outlines\nfrom pydantic import BaseModel\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\n\nclass Person(BaseModel):\n    name: str\n    age: int\n\nmodel = outlines.from_transformers(\n    AutoModelForCausalLM.from_pretrained(\"microsoft\u002FPhi-3-mini-4k-instruct\", device_map=\"auto\"),\n    AutoTokenizer.from_pretrained(\"microsoft\u002FPhi-3-mini-4k-instruct\"),\n)\n\nresult = model(\"Generate person: Alice, 25\", Person)\nperson = Person.model_validate_json(result)\n```\n\n### 2. Output Types\n\nIn v1 you pass the desired **output type** directly as the second argument.\n\n#### Multiple choice (`Literal`)\n\n```python\nfrom typing import Literal\n\nsentiment = model(\"Review: This is great!\", Literal[\"positive\", \"negative\", \"neutral\"])\n# Result: one of the three choices\n```\n\n#### JSON via Pydantic\n\n```python\nfrom pydantic import BaseModel\n\nclass Product(BaseModel):\n    name: str\n    price: float\n    in_stock: bool\n\nresult = model(\"Extract: iPhone 15, $999, available\", Product)\nproduct = Product.model_validate_json(result)  # valid Product instance\n```\n\n#### Regex (pass a regex string)\n\n```python\n# Generate text matching a regex pattern\nphone = model(\"Generate phone number:\", r\"[0-9]{3}-[0-9]{3}-[0-9]{4}\")\n# Result: \"555-123-4567\" (guaranteed to match the pattern)\n```\n\n#### Numeric types\n\n```python\n# Pass the Python type directly\nage = model(\"Person's age:\", int)      # guaranteed integer\nprice = model(\"Product price:\", float)  # guaranteed float\n```\n\n### 3. Model Backends\n\nOutlines supports multiple local and API-based backends via `from_*` factories.\n\n#### Transformers (Hugging Face)\n\n```python\nimport outlines\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\n\nmodel = outlines.from_transformers(\n    AutoModelForCausalLM.from_pretrained(\"microsoft\u002FPhi-3-mini-4k-instruct\", device_map=\"auto\"),\n    AutoTokenizer.from_pretrained(\"microsoft\u002FPhi-3-mini-4k-instruct\"),\n)\n\nresult = model(prompt, YourModel)\n```\n\n#### llama.cpp\n\n```python\nimport outlines\nfrom llama_cpp import Llama\n\nllm = Llama(\".\u002Fmodels\u002Fllama-3.1-8b-instruct.Q4_K_M.gguf\", n_gpu_layers=35, n_ctx=4096)\nmodel = outlines.from_llamacpp(llm)\n\nresult = model(prompt, YourModel)\n```\n\n#### vLLM (High Throughput)\n\n```python\nimport outlines\nfrom vllm import LLM\n\nllm = LLM(\"meta-llama\u002FLlama-3.1-8B-Instruct\", tensor_parallel_size=2)\nmodel = outlines.from_vllm(llm)\n\nresult = model(prompt, YourModel)\n```\n\n#### OpenAI (server-side constrained JSON)\n\n```python\nimport outlines\nfrom openai import OpenAI\n\nclient = OpenAI()\nmodel = outlines.from_openai(client, \"gpt-4o-mini\")\n\n# API backends support JSON-schema style structured output\nresult = model(prompt, YourModel)\n```\n\n### 4. Pydantic Integration\n\nOutlines has first-class Pydantic support with automatic schema translation.\nGeneration returns a JSON string; call `model_validate_json` to get an instance.\n\n#### Basic Models\n\n```python\nfrom pydantic import BaseModel, Field\n\nclass Article(BaseModel):\n    title: str = Field(description=\"Article title\")\n    author: str = Field(description=\"Author name\")\n    word_count: int = Field(description=\"Number of words\", gt=0)\n    tags: list[str] = Field(description=\"List of tags\")\n\nresult = model(\"Generate article about AI\", Article, max_new_tokens=300)\narticle = Article.model_validate_json(result)\nprint(article.title)\nprint(article.word_count)  # Guaranteed > 0\n```\n\n#### Nested Models\n\n```python\nclass Address(BaseModel):\n    street: str\n    city: str\n    country: str\n\nclass Person(BaseModel):\n    name: str\n    age: int\n    address: Address  # Nested model\n\nresult = model(\"Generate person in New York\", Person)\nperson = Person.model_validate_json(result)\nprint(person.address.city)  # \"New York\"\n```\n\n#### Enums and Literals\n\n```python\nfrom enum import Enum\nfrom typing import Literal\n\nclass Status(str, Enum):\n    PENDING = \"pending\"\n    APPROVED = \"approved\"\n    REJECTED = \"rejected\"\n\nclass Application(BaseModel):\n    applicant: str\n    status: Status  # Must be one of enum values\n    priority: Literal[\"low\", \"medium\", \"high\"]  # Must be one of literals\n\nresult = model(\"Generate application\", Application)\napp = Application.model_validate_json(result)\nprint(app.status)  # Status.PENDING (or APPROVED\u002FREJECTED)\n```\n\n## Common Patterns\n\n### Pattern 1: Data Extraction\n\n```python\nfrom pydantic import BaseModel\nimport outlines\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\n\nclass CompanyInfo(BaseModel):\n    name: str\n    founded_year: int\n    industry: str\n    employees: int\n\nmodel = outlines.from_transformers(\n    AutoModelForCausalLM.from_pretrained(\"microsoft\u002FPhi-3-mini-4k-instruct\", device_map=\"auto\"),\n    AutoTokenizer.from_pretrained(\"microsoft\u002FPhi-3-mini-4k-instruct\"),\n)\n\ntext = \"\"\"\nApple Inc. was founded in 1976 in the technology industry.\nThe company employs approximately 164,000 people worldwide.\n\"\"\"\n\nprompt = f\"Extract company information:\\n{text}\\n\\nCompany:\"\ncompany = CompanyInfo.model_validate_json(model(prompt, CompanyInfo, max_new_tokens=200))\n\nprint(f\"Name: {company.name}\")\nprint(f\"Founded: {company.founded_year}\")\nprint(f\"Industry: {company.industry}\")\nprint(f\"Employees: {company.employees}\")\n```\n\n### Pattern 2: Classification\n\n```python\nfrom typing import Literal\nfrom pydantic import BaseModel\n\n# Binary classification\nresult = model(\"Email: Buy now! 50% off!\", Literal[\"spam\", \"not_spam\"])\n\n# Multi-class classification\ncategory = model(\n    \"Article: Apple announces new iPhone...\",\n    Literal[\"technology\", \"business\", \"sports\", \"entertainment\"],\n)\n\n# With confidence\nclass Classification(BaseModel):\n    label: Literal[\"positive\", \"negative\", \"neutral\"]\n    confidence: float\n\nout = model(\"Review: This product is okay, nothing special\", Classification)\nresult = Classification.model_validate_json(out)\n```\n\n### Pattern 3: Structured Forms\n\n```python\nclass UserProfile(BaseModel):\n    full_name: str\n    age: int\n    email: str\n    phone: str\n    country: str\n    interests: list[str]\n\nprompt = \"\"\"\nExtract user profile from:\nName: Alice Johnson\nAge: 28\nEmail: alice@example.com\nPhone: 555-0123\nCountry: USA\nInterests: hiking, photography, cooking\n\"\"\"\n\nprofile = UserProfile.model_validate_json(model(prompt, UserProfile, max_new_tokens=250))\nprint(profile.full_name)\nprint(profile.interests)  # [\"hiking\", \"photography\", \"cooking\"]\n```\n\n### Pattern 4: Multi-Entity Extraction\n\n```python\nfrom typing import Literal\n\nclass Entity(BaseModel):\n    name: str\n    type: Literal[\"PERSON\", \"ORGANIZATION\", \"LOCATION\"]\n\nclass DocumentEntities(BaseModel):\n    entities: list[Entity]\n\ntext = \"Tim Cook met with Satya Nadella at Microsoft headquarters in Redmond.\"\nprompt = f\"Extract entities from: {text}\"\n\nresult = DocumentEntities.model_validate_json(model(prompt, DocumentEntities, max_new_tokens=300))\nfor entity in result.entities:\n    print(f\"{entity.name} ({entity.type})\")\n```\n\n### Pattern 5: Code Generation\n\n```python\nclass PythonFunction(BaseModel):\n    function_name: str\n    parameters: list[str]\n    docstring: str\n    body: str\n\nprompt = \"Generate a Python function to calculate factorial\"\nfunc = PythonFunction.model_validate_json(model(prompt, PythonFunction, max_new_tokens=300))\n\nprint(f\"def {func.function_name}({', '.join(func.parameters)}):\")\nprint(f'    \"\"\"{func.docstring}\"\"\"')\nprint(f\"    {func.body}\")\n```\n\n### Pattern 6: Batch Processing\n\n```python\nimport outlines\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\nfrom pydantic import BaseModel\n\nclass Person(BaseModel):\n    name: str\n    age: int\n\nmodel = outlines.from_transformers(\n    AutoModelForCausalLM.from_pretrained(\"microsoft\u002FPhi-3-mini-4k-instruct\", device_map=\"auto\"),\n    AutoTokenizer.from_pretrained(\"microsoft\u002FPhi-3-mini-4k-instruct\"),\n)\n\ntexts = [\n    \"John is 30 years old\",\n    \"Alice is 25 years old\",\n    \"Bob is 40 years old\",\n]\n\n# v1 accepts a list of prompts for batched generation\nprompts = [f\"Extract from: {t}\" for t in texts]\noutputs = model(prompts, Person, max_new_tokens=100)\npeople = [Person.model_validate_json(o) for o in outputs]\nfor person in people:\n    print(f\"{person.name}: {person.age}\")\n```\n\n## Backend Configuration\n\n### Transformers\n\n```python\nimport outlines\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\n\nMODEL_NAME = \"microsoft\u002FPhi-3-mini-4k-instruct\"\n\n# Basic usage\nmodel = outlines.from_transformers(\n    AutoModelForCausalLM.from_pretrained(MODEL_NAME, device_map=\"auto\"),\n    AutoTokenizer.from_pretrained(MODEL_NAME),\n)\n\n# GPU + dtype configuration is set on the HF model itself\nimport torch\nmodel = outlines.from_transformers(\n    AutoModelForCausalLM.from_pretrained(MODEL_NAME, device_map=\"cuda\", torch_dtype=torch.float16),\n    AutoTokenizer.from_pretrained(MODEL_NAME),\n)\n\n# Popular models\nfor name in [\n    \"meta-llama\u002FLlama-3.1-8B-Instruct\",\n    \"mistralai\u002FMistral-7B-Instruct-v0.3\",\n    \"Qwen\u002FQwen2.5-7B-Instruct\",\n]:\n    model = outlines.from_transformers(\n        AutoModelForCausalLM.from_pretrained(name, device_map=\"auto\"),\n        AutoTokenizer.from_pretrained(name),\n    )\n```\n\n### llama.cpp\n\n```python\nimport outlines\nfrom llama_cpp import Llama\n\n# Load GGUF model\nllm = Llama(\n    \".\u002Fmodels\u002Fllama-3.1-8b.Q4_K_M.gguf\",\n    n_ctx=4096,       # Context window\n    n_gpu_layers=35,  # GPU layers\n    n_threads=8,      # CPU threads\n)\nmodel = outlines.from_llamacpp(llm)\n\n# Full GPU offload: set n_gpu_layers=-1 on the Llama object\n```\n\n### vLLM (Production)\n\n```python\nimport outlines\nfrom vllm import LLM\n\n# Single GPU\nmodel = outlines.from_vllm(LLM(\"meta-llama\u002FLlama-3.1-8B-Instruct\"))\n\n# Multi-GPU\nmodel = outlines.from_vllm(LLM(\"meta-llama\u002FLlama-3.1-70B-Instruct\", tensor_parallel_size=4))\n\n# With quantization\nmodel = outlines.from_vllm(LLM(\"meta-llama\u002FLlama-3.1-8B-Instruct\", quantization=\"awq\"))\n```\n\n## Best Practices\n\n### 1. Use Specific Types\n\n```python\n# ✅ Good: Specific types\nclass Product(BaseModel):\n    name: str\n    price: float  # Not str\n    quantity: int  # Not str\n    in_stock: bool  # Not str\n\n# ❌ Bad: Everything as string\nclass Product(BaseModel):\n    name: str\n    price: str  # Should be float\n    quantity: str  # Should be int\n```\n\n### 2. Add Constraints\n\n```python\nfrom pydantic import Field\n\n# ✅ Good: With constraints\nclass User(BaseModel):\n    name: str = Field(min_length=1, max_length=100)\n    age: int = Field(ge=0, le=120)\n    email: str = Field(pattern=r\"^[\\w\\.-]+@[\\w\\.-]+\\.\\w+$\")\n\n# ❌ Bad: No constraints\nclass User(BaseModel):\n    name: str\n    age: int\n    email: str\n```\n\n### 3. Use Enums for Categories\n\n```python\n# ✅ Good: Enum for fixed set\nclass Priority(str, Enum):\n    LOW = \"low\"\n    MEDIUM = \"medium\"\n    HIGH = \"high\"\n\nclass Task(BaseModel):\n    title: str\n    priority: Priority\n\n# ❌ Bad: Free-form string\nclass Task(BaseModel):\n    title: str\n    priority: str  # Can be anything\n```\n\n### 4. Provide Context in Prompts\n\n```python\n# ✅ Good: Clear context\nprompt = \"\"\"\nExtract product information from the following text.\nText: iPhone 15 Pro costs $999 and is currently in stock.\nProduct:\n\"\"\"\n\n# ❌ Bad: Minimal context\nprompt = \"iPhone 15 Pro costs $999 and is currently in stock.\"\n```\n\n### 5. Handle Optional Fields\n\n```python\nfrom typing import Optional\n\n# ✅ Good: Optional fields for incomplete data\nclass Article(BaseModel):\n    title: str  # Required\n    author: Optional[str] = None  # Optional\n    date: Optional[str] = None  # Optional\n    tags: list[str] = []  # Default empty list\n\n# Can succeed even if author\u002Fdate missing\n```\n\n### 6. Always Validate JSON Output\n\n```python\n# v1 returns a JSON string for Pydantic\u002FJSON output types.\nresult = model(prompt, Article)          # str\narticle = Article.model_validate_json(result)  # Article instance\n```\n\n## Comparison to Alternatives\n\n| Feature | Outlines | Instructor | Guidance | LMQL |\n|---------|----------|------------|----------|------|\n| Pydantic Support | ✅ Native | ✅ Native | ✅ Yes | ❌ No |\n| JSON Schema | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |\n| Regex Constraints | ✅ Yes | ❌ No | ✅ Yes | ✅ Yes |\n| Local Models | ✅ Full | ⚠️ Limited | ✅ Full | ✅ Full |\n| API Models | ✅ Yes | ✅ Full | ✅ Yes | ✅ Full |\n| Zero Overhead | ✅ Yes | ❌ No | ⚠️ Partial | ✅ Yes |\n| Automatic Retrying | ❌ No | ✅ Yes | ❌ No | ❌ No |\n| Learning Curve | Low | Low | Low | High |\n\n**When to choose Outlines:**\n- Using local models (Transformers, llama.cpp, vLLM)\n- Need maximum inference speed\n- Want Pydantic model support\n- Require zero-overhead structured generation\n- Control token sampling process\n\n**When to choose alternatives:**\n- Instructor: Need API models with automatic retrying\n- Guidance: Need token healing and complex workflows\n- LMQL: Prefer declarative query syntax\n\n## Performance Characteristics\n\n**Speed:**\n- **Zero overhead**: Structured generation as fast as unconstrained\n- **Fast-forward optimization**: Skips deterministic tokens\n- **1.2-2x faster** than post-generation validation approaches\n\n**Memory:**\n- Automaton compiled once per output type (cached)\n- Minimal runtime overhead\n- Efficient with vLLM for high throughput\n\n**Accuracy:**\n- **100% valid outputs** (guaranteed by the constrained automaton)\n- No retry loops needed\n- Deterministic token filtering\n\n## Resources\n\n- **Documentation**: https:\u002F\u002Fdottxt-ai.github.io\u002Foutlines\u002F\n- **GitHub**: https:\u002F\u002Fgithub.com\u002Fdottxt-ai\u002Foutlines (12k+ stars)\n- **Discord**: https:\u002F\u002Fdiscord.gg\u002FR9DSu34mGd\n- **Blog**: https:\u002F\u002Fblog.dottxt.co\n\n## See Also\n\n- `references\u002Fjson_generation.md` - Comprehensive JSON and Pydantic patterns\n- `references\u002Fbackends.md` - Backend-specific configuration\n- `references\u002Fexamples.md` - Production-ready examples\n",{"name":5,"author":24,"license":15,"version":25,"metadata":26,"platforms":39,"description":7,"dependencies":43},"Orchestra Research","1.0.1",{"hermes":27},{"tags":28},[29,30,31,32,33,34,35,36,37,38],"Prompt Engineering","Outlines","Structured Generation","JSON Schema","Pydantic","Local Models","Grammar-Based Generation","vLLM","Transformers","Type Safety",[40,41,42],"linux","macos","windows",[5,44,45,46],"transformers","vllm","pydantic","main","2e6aa8d15ab0a366c90be54f61bf9c6e97015e83","skills\u002Fmlops\u002Finference\u002Foutlines",1,"https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet","steadfaste.com","https:\u002F\u002Fgithub.com\u002Flukemcqueen","AI Architect | Building Hermes Cortex: governed multi-agent AI for autonomous software engineering | Enterprise Tech Consultant","2026-11-14 22:33:34",{"source":8,"skillName":5,"commands":57,"prompt":67,"zipAvailable":68},[58,61,64],{"tool":59,"command":60},"npx","npx skills add lukemcqueen\u002Fsteadfaste-fleet --skill outlines",{"tool":62,"command":63},"bunx","bunx skills add lukemcqueen\u002Fsteadfaste-fleet --skill outlines",{"tool":65,"command":66},"pnpm","pnpm dlx skills add lukemcqueen\u002Fsteadfaste-fleet --skill outlines","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fmlops\u002Finference\u002Foutlines\u002FSKILL.md",true,[],[71,79,86,93,100,107],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":78},"01M7DXY4G8NSVB59K8B6S2AQNP","macbook-linux-maintenance","Legacy MacBook Linux fixes: GPU wedge, reboot hang, thermal.","https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fmacbook-linux-maintenance\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":78},"01M7DXXYJCXFJ3TGB84ZQ8KFE6","governance-regression-triage","Triage a host's governance issues: what changed.","https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fgovernance-regression-triage\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":78},"01M7DXXSAP1G8FDRJAMXQGBBMK","enforcement-immutability","Use when enforcement files lose their immutable flag.","https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fenforcement-immutability\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":78},"01M78SSDQVRYX64Y16X32TC0NS","steadfaste-fleet-repo-deploy","Use when committing to the steadfaste-fleet repo.","https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fsteadfaste-fleet-repo-deploy\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":78},"01M78SS928F3R2RJAYVW4E30CE","steadfaste-fleet-maintenance","Maintain an installed Steadfaste Fleet instance — update both the upstream Hermes Agent and the fleet repo layer, merge diverged histories, sync skills safely, and troubleshoot common issues. Covers the dual-update workflow (hermes update + fleet-update.sh), encrypted brain data backup, mycortex import, and recovery techniques.","https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fsteadfaste-fleet-maintenance\u002FSKILL.md",[],[],{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":78},"01M78SP1CHW0T0BWE5ZT6JBPX8","fleet-preflight","DEPRECATED alias — merged into survey-before-action (2026-08-20). Load survey-before-action instead; its \"Repo-Specific Pre-Flight\" section covers git search, Hermes boundary, and deployment verification.","https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Ffleet-preflight\u002FSKILL.md",[],[]]