AGENT SKILL

providers

Choose, configure, inspect, and troubleshoot LangExtract model providers and batch backends.

License 许可
Apache-2.0
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
providers
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Choose, configure, inspect, and troubleshoot LangExtract model providers and batch backends.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

LangExtract Providers

Use this sub-skill when a task depends on selecting or configuring the LangExtract language-model backend: Gemini, Vertex AI, OpenAI/GPT, OpenAI-compatible endpoints, Ollama/local models, provider routing, provider kwargs, or batch behavior.

Fast route

  1. Decide whether the user is doing provider setup or prompt/extraction design.
    • Provider/backend choice, API keys, ModelConfig, language_model_params, batch mode, Ollama daemon/model checks: stay here.
    • Prompt, examples, output_schema shape, tokenization, resolver tuning, or extraction result grounding: route to extraction.
    • Custom provider package scaffolding, entry points, plugin conflicts, or schema implementation for a new provider: route to provider-plugins.
    • JSONL persistence or HTML output: route to visualization.
  2. Inspect routing without secrets or network by running the bundled route checker:
    python sub-skills/providers/scripts/check_provider_routes.py
    
  3. Use references/providers.md for exact provider patterns, factory APIs, environment-variable precedence, schema/fence interactions, and batch configuration.
  4. Use references/troubleshooting.md when provider creation or inference fails.
  5. For local Ollama, start with a preflight-only check before inference:
    python sub-skills/providers/scripts/ollama_demo.py --model gemma2:2b --preflight-only
    

Provider selection checklist

  • Prefer model_id auto-routing for known IDs: gemini... for Gemini, gpt-4... or gpt-5... for OpenAI, and common local IDs such as gemma2:2b, llama3.2:1b, qwen..., or gpt-oss... for Ollama.
  • Use langextract.factory.ModelConfig(provider=..., provider_kwargs=...) when a model ID does not match a built-in pattern, when an OpenAI-compatible endpoint uses a non-GPT ID, or when multiple providers could match.
  • Do not put secrets in generated code. Read API keys from environment variables or caller-owned secret stores.
  • Treat live Gemini/OpenAI/Vertex/Ollama checks as optional. This sub-skill only establishes configuration and local/no-network inspection unless the caller explicitly supplies credentials or a local daemon.
  • Batch APIs are opt-in and only trigger when the prompt/chunk count meets the configured threshold.

Runtime helpers

  • scripts/check_provider_routes.py: safe, no-network provider registry and sample model-ID resolver.
  • scripts/ollama_demo.py: local Ollama preflight plus optional tiny extraction demo. It does not require the source repository checkout.

Evidence basis

This guidance is distilled from README.md, langextract/providers/README.md, docs/examples/batch_api_example.md, examples/ollama/, langextract/factory.py, langextract/providers/router.py, builtin_registry.py, patterns.py, gemini.py, openai.py, ollama.py, gemini_batch.py, openai_batch.py, and provider schema modules. Related native verification candidates include factory_test.py, factory_schema_test.py, provider_schema_test.py, inference_test.py, test_kwargs_passthrough.py, test_gemini_batch_api.py, gemini_retry_test.py, openai_batch_test.py, optional test_live_api.py, and optional test_ollama_integration.py; do not run those from this sub-skill unless the root verification plan asks for them.

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