AGENT SKILL

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

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

  1. 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).
  2. Install the smallest optional stack. Install only the extra and runtime required by the selected wrapper. Do not install every Outlines extra.
  3. Validate prerequisite imports and devices. Run scripts/check_local_model_prereqs.py before downloading models or allocating GPU memory.
  4. 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.
  5. Wrap with Outlines. The local wrapper exposes model(prompt, output_type=None, backend=None, **kwargs), batch where supported, and stream where supported.
  6. Pick the output type and backend. Use ../structured-generation/SKILL.md for JSON/regex/CFG and backend choices.
  7. 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

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 outlines imports.
  • 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_vllm server mode with from_vllm_offline; server mode belongs in ../remote-providers/SKILL.md.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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).

★ 351