Model client and generator workflows

From VectorSpaceLab/AREX-Skill · View interactive version

Model client and generator workflows is an AI agent skill from the GitHub repository VectorSpaceLab/AREX-Skill. Use AdalFlow ModelClient, Generator, and Embedder workflows for provider integration, prompt/model kwargs, output processors, caching, streaming basics, and no-credential fake-client tests.

How to use this skill

Skill file

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

Route elsewhere

Internal references

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.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.