AGENT SKILL

model-client-and-generator-workflows

Use AdalFlow ModelClient, Generator, and Embedder workflows for provider integration, prompt/model kwargs, output processors, caching, streaming basics, and no-credential fake-client tests.

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

01 前言 Front Matter

name
model-client-and-generator-workflows
license
MIT
metadata
{ "disco-role": "operating" }
description
Use AdalFlow ModelClient, Generator, and Embedder workflows for provider integration, prompt/model kwargs, output processors, caching, streaming basics, and no-credential fake-client tests.
disable-model-invocation
true

02 资源文件 5

03 SKILL.md 正文

Model Client and Generator Workflows

Use this sub-skill when a task involves AdalFlow model-provider plumbing rather than retrieval, agents, optimization, or tracing.

Load when

  • Building or debugging Generator, ModelClient, Embedder, or BatchEmbedder flows.
  • Selecting provider clients or optional extras for OpenAI/OpenAI-compatible, Anthropic, Groq, Google, Ollama, Together, Cohere, Azure, Bedrock, Fireworks, Mistral, DeepSeek, XAI, SambaNova, or local Transformer integrations.
  • Configuring prompt templates, prompt_kwargs, model_kwargs, ModelType, output processors, cache behavior, or streaming response handling.
  • Writing no-network tests with a fake ModelClient.

Route elsewhere

  • RAG, indexes, retrievers, LocalDB, vector stores, and document pipelines: use retrieval-rag-and-data-pipelines.
  • Agent, Runner, ReAct, FunctionTool, tool streaming, permissions, and MCP: use agents-tools-and-streaming.
  • Evaluation, datasets, Trainer, optimizers, text gradients, and few-shot training: use evaluation-and-optimization.
  • Logging, generator-state/call loggers, callback tracing, MLflow, and config utilities: use tracing-observability-and-configuration.
  • Core Component, Prompt, DataClass, and parser schema construction without model calls: use core-components-and-structured-io.

Internal references

  • Generator workflows: prompt rendering, call/acall/forward, output processors, caching, streaming, fake-client tests, embedder orchestration.
  • Model clients: protocol requirements, provider extras/lazy imports, provider notes, OpenAI-compatible patterns, direct client usage.
  • API reference: verified signatures, return fields, ModelType, GeneratorOutput, EmbedderOutput, and concise call contracts.
  • Troubleshooting: optional SDK/API-key errors, bad model_kwargs, parser failures, GeneratorOutput.error, cache surprises, streaming, and image/content formatting.
  • Fake-client smoke script: deterministic no-credential sanity check for Generator, JsonParser, Embedder, and BatchEmbedder.

Operating checklist

  1. Decide whether the workflow is service-free or requires a live provider. Prefer the bundled fake-client script for unit tests and examples.
  2. Pick the correct ModelType: LLM for text generation, LLM_REASONING for reasoning-compatible LLM endpoints, EMBEDDER for embeddings, and provider-specific types only after checking support.
  3. Keep model_kwargs provider-shaped and JSON-serializable when caching is enabled. Pass per-call overrides through Generator.call(..., model_kwargs={...}) or Embedder.call(..., model_kwargs={...}).
  4. Render and inspect the prompt with generator.get_prompt(...) before blaming the provider. Missing or mismatched Jinja variables usually become poor prompts, not provider errors.
  5. Treat GeneratorOutput.error as the authoritative failure signal. Check raw_response, api_response, and parser configuration before retrying live API calls.
  6. For streaming, consume raw_response/stream_events() and do not expect structured output processors to run until a complete text response is available.
  7. Do not embed API keys in generated code or logs. Use provider environment variables or explicit runtime configuration supplied by the caller.

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