local-models
Set up and troubleshoot Outlines local steerable model integrations for Transformers, llama.cpp, MLX-LM, and vLLM offline.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- local-models
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Set up and troubleshoot Outlines local steerable model integrations for Transformers, llama.cpp, MLX-LM, and vLLM offline.
- disable-model-invocation
- true
02 资源文件 6
- 参考文档references/api-reference.md3.6 KB
- 参考文档references/compatibility.md4.2 KB
- 参考文档references/custom-logits-processors.md2.0 KB
- 参考文档references/troubleshooting.md3.6 KB
- 参考文档references/workflows.md3.4 KB
- 脚本scripts/check_local_model_prereqs.py5.7 KB
03 SKILL.md 正文
Local Models
Use this sub-skill when an Outlines task needs an offline or local inference engine whose tokens/logits can be steered: Hugging Face Transformers, Transformers multimodal processors, llama.cpp, MLX-LM, or vLLM offline.
This sub-skill is for setup planning, compatibility checks, and local-runtime troubleshooting. It does not download models, install GPU stacks, start services, or claim that CUDA/MPS runtime was verified. After a local model object exists, route output-type design to ../structured-generation/SKILL.md and prompt/chat construction to ../prompt-workflows/SKILL.md.
Quick Route
- Choose the local wrapper.
- Transformers text or multimodal:
outlines.from_transformers(model, tokenizer_or_processor, device_dtype=None). - llama.cpp:
outlines.from_llamacpp(llama, chat_mode=True). - MLX-LM:
outlines.from_mlxlm(model, tokenizer). - vLLM offline:
outlines.from_vllm_offline(llm).
- Transformers text or multimodal:
- Install the smallest optional stack. Install only the extra and runtime required by the selected wrapper. Do not install every Outlines extra.
- Validate prerequisite imports and devices. Run
scripts/check_local_model_prereqs.pybefore downloading models or allocating GPU memory. - Create the vendor model/tokenizer/client object using that library. Outlines wraps an existing object; it does not hide the underlying library's model acquisition.
- Wrap with Outlines. The local wrapper exposes
model(prompt, output_type=None, backend=None, **kwargs),batchwhere supported, andstreamwhere supported. - Pick the output type and backend. Use
../structured-generation/SKILL.mdfor JSON/regex/CFG and backend choices. - Treat hardware failures as runtime constraints. CUDA, VRAM, MPS, GGUF compilation, tokenizer chat templates, and vLLM guided decoding are not prompt errors.
Load These References
references/api-reference.md: loader signatures, local model call patterns, input/output behavior, batch/stream notes, and tokenizer facts.references/compatibility.md: optional dependencies, hardware, backend/output support, and what was not verified in the base inspection environment.references/workflows.md: setup recipes for Transformers, multimodal Transformers, llama.cpp, MLX-LM, and vLLM offline.references/custom-logits-processors.md: extending local generation with anOutlinesLogitsProcessor.references/troubleshooting.md: local runtime errors and recovery steps.
Bundled Script
Run the read-only prerequisite probe before a local-model setup:
python scripts/check_local_model_prereqs.py --targets transformers vllm-offline --format text
The script checks optional module availability and basic device visibility without installing packages, downloading model weights, or calling network services.
Non-Negotiable Checks
- Do not claim local CUDA/vLLM/Transformers generation works just because
outlinesimports. - Do not claim MLX-LM is available on Linux or non-Apple-Silicon hardware.
- Do not use CPU importability as proof of vLLM offline GPU readiness.
- Do not tell future agents to run original repository examples. Distill or reproduce safe checks inside this generated skill.
- Do not confuse
from_vllmserver mode withfrom_vllm_offline; server mode belongs in../remote-providers/SKILL.md.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).