UI はローカライズ済みです。スキルの紹介と説明文書は選択した言語へ AI が自動翻訳し、コード・コマンド・パス・専門用語は原文のままです。原作者の文書が優先されます。
スキルを探す
生産性・共同作業 · SKILL.md

outlines

outlines

Operate the Outlines structured-output library across output types, local models, provider integrations, and prompt workflows.

Independent GitHub snapshot · Automated classification · Original documentation governs

スキルの説明

GitHub

name: outlines description: "Operate the Outlines structured-output library across output types, local models, provider integrations, and prompt workflows." metadata: disco-role: operating disable-model-invocation: true license: Apache 2.0

Outlines Repo Skill

Use this repo skill when a task involves Outlines as a Python package for structured outputs from large language models: defining schemas or regex/CFG constraints, wrapping local or hosted models, rendering prompt templates, composing chat/multimodal inputs, and troubleshooting package/provider/runtime behavior.

This skill is self-contained. Do not reopen the source checkout to use it. The source repository was used only as evidence for these bundled routes, references, and scripts.

Install and Import Check

Base install:

pip install outlines

Optional integrations are installed separately; choose only the backend/provider you need. Examples:

pip install transformers torch       # local Transformers path
pip install llama-cpp-python         # llama.cpp path
pip install vllm                     # vLLM offline/server client path as appropriate
pip install openai                   # OpenAI, SGLang, vLLM server SDK clients
pip install huggingface_hub          # TGI client

Minimal import check:

import outlines
from outlines import Generator, Template
from outlines.inputs import Chat, Image
from outlines.types import JsonSchema, Regex, CFG, Choice

Important: in this source revision, Chat is imported from outlines.inputs, not from the top-level outlines namespace.

Route by Task

Task signalRead
JSON/Pydantic/dataclass/TypedDict/GenSON output, Literal/Enum/Choice, regex, CFG, Generator, backend selection, custom logits processor, parsing generated JSONsub-skills/structured-generation/SKILL.md
Local/offline model setup with Transformers, Transformers multimodal, llama.cpp, MLX-LM, vLLM offline, tokenizers, device dtype, CUDA/MPS/VRAM, local batch/stream behaviorsub-skills/local-models/SKILL.md
Hosted or server-based providers: OpenAI/Azure, Anthropic, Gemini, Mistral, Ollama, LM Studio, SGLang, TGI, vLLM server, Dottxt; credentials/endpoints; provider exceptionssub-skills/remote-providers/SKILL.md
Prompt templates, Application, Chat, Image/Audio/Video, Jinja filters, cache controls, safe self-consistency/task-loop recipessub-skills/prompt-workflows/SKILL.md

Repo-Level References

Safe Helper Scripts

  • scripts/inspect_outlines_api.py: read-only import/signature smoke for a local Python environment.
  • sub-skills/structured-generation/scripts/validate_structure.py: local JSON Schema or regex validator.
  • sub-skills/local-models/scripts/check_local_model_prereqs.py: no-network optional module/device probe.
  • sub-skills/remote-providers/scripts/check_provider_prereqs.py: no-network provider SDK/env-var probe with secrets redacted.
  • sub-skills/prompt-workflows/scripts/render_template.py: local Template renderer.

Operating Rules

  1. Keep output-type design separate from model/provider selection. First define the structure, then pick a compatible execution route.
  2. Treat Outlines generation outputs as raw strings unless a provider wrapper explicitly returns something else; parse or validate after generation.
  3. Do not install broad extras or GPU stacks unless the task explicitly needs that runtime.
  4. Do not call provider services, download models, or start long-running servers during planning or static troubleshooting.
  5. Never execute model-generated code (eval, exec, shell) while using this skill. Validate with schemas, regex, parsers, and bounded tests.
  6. For remote errors, catch outlines.exceptions.APIError subclasses and use retryable, provider, status_code, request_id, and hint to decide recovery.
  7. For local hardware, verify the actual framework/backend runtime before claiming CUDA, MPS, vLLM, or llama.cpp acceleration works.
保存したスキル