llm-provider-config
Configure direct LLM, embedding, and model-provider access for Langroid agents without mixing in agent orchestration.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- llm-provider-config
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Configure direct LLM, embedding, and model-provider access for Langroid agents without mixing in agent orchestration.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/embedding-config.md7.8 KB
- 参考文档references/model-selection.md6.8 KB
- 参考文档references/provider-config.md12.0 KB
- 参考文档references/troubleshooting.md8.7 KB
- 脚本scripts/provider_config_smoke.py20.8 KB
03 SKILL.md 正文
llm-provider-config
Use this sub-skill when the task is to choose, build, validate, or troubleshoot Langroid LLM and embedding provider configuration. Stay at the provider-access layer: OpenAIGPTConfig, OpenAIGPT, AzureConfig, provider model strings, OpenAI-compatible api_base endpoints, API-key handling, HTTP clients, streaming/reasoning flags, and embedding config classes.
Scope boundary
- Include direct LLM access, OpenAI-compatible bases, Azure, Gemini, LiteLLM proxy, LiteLLM adapter strings, Ollama/local servers, OpenRouter-style gateways, Portkey, LangDB, rotating API keys, cached clients, HTTP client config, and embedding provider configs.
- Exclude agent design, task loops, tool messages, function-calling workflows, and prompt orchestration; route those to
../agents-tasks-tools/SKILL.md. - Exclude RAG/vector-store wiring beyond selecting an embedding config; route retrieval or document-chat wiring to
../retrieval-doc-chat/SKILL.md. - Exclude MCP server/tool integration; route it to
../integrations-mcp-chainlit/SKILL.md.
Operating procedure
- Identify whether the user needs an LLM config, an embedding config, or both.
- Choose the smallest direct provider path before adding a proxy or gateway:
- native OpenAI or Azure when the deployment is actually OpenAI/Azure;
- provider prefix such as
gemini/,openrouter/,ollama/,vllm/,llamacpp/,langdb/, orportkey/when Langroid has a first-class path; - explicit
api_basefor a generic OpenAI-compatible endpoint; litellm-proxy/only for a deployed LiteLLM proxy server;litellm/only for the local LiteLLM adapter library.
- Validate model string, API-key source, base URL shape, timeout/temperature/output-token settings, cache behavior, and optional HTTP-client needs before any generation call.
- For embeddings, configure only the embedding provider and dimensions here; leave collection/index/vector-store construction to the retrieval sub-skill.
- Use the bundled smoke script for no-network sanity checks when a config looks suspicious.
Bundled references
- Provider configuration: LLM config fields, provider prefixes, Azure, gateway parameters, caching, HTTP clients, rotating credentials, and reasoning content.
- Embedding configuration: OpenAI, Azure OpenAI, Gemini, LangDB, SentenceTransformer, FastEmbed, and llama.cpp-server embedding configs.
- Model selection: choosing strings/enums, direct vs proxy access, local-server forms, formatter suffixes, and environment-prefix pitfalls.
- Troubleshooting: missing keys, bad bases, Azure deployment names, Gemini/Vertex base handling, LiteLLM confusion, key rotation, client caching, and optional embedding dependencies.
No-network smoke check
Run:
python scripts/provider_config_smoke.py
The script sanitizes provider environment variables for deterministic output, constructs representative provider and embedding configs, avoids chat(), generate(), and embedding calls, and falls back to a static source-derived check if optional runtime dependencies are not installed. Use --help for options.
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).