llm-provider-contract

Standardize LLM provider integrations into a unified contract for requests, responses, streaming, and errors.

Updated May 19, 2026
One-click install
npx skills add https://github.com/zxc1a1a1/Multi_Agent-AgentHub --skill llm-provider-contract
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: llm-provider-contract
Source: https://github.com/zxc1a1a1/Multi_Agent-AgentHub/tree/main/.agents/skills/llm-provider-contract
Command: npx skills add https://github.com/zxc1a1a1/Multi_Agent-AgentHub --skill llm-provider-contract

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

AgentHub needs a consistent, safe way to integrate multiple LLM providers and models without leaking provider-specific formats, secrets, or inconsistent streaming/structured-output behaviors into business code.

Core Features & Use Cases

  • Unified Provider Adapter Contract: Enforces a common LLMRequest, LLMResponse, LLMStreamEvent, and SafeLLMError shape so the rest of the system never depends on provider SDK specifics.
  • Streaming Normalization & Structured Output Guardrails: Normalizes provider streams into AgentHub events and requires local JSON Schema validation before structured data is accepted.
  • Reliability, Fallback, and Safety Policies: Defines timeout/retry/rate-limit boundaries, capability-aware fallback rules, and strict secret/config handling with error normalization and tracing requirements.

Quick Start

Instruct an adapter implementation to follow the llm-provider-contract YAML-less policy by routing every LLM call through the unified Provider Adapter, emitting only normalized LLMStreamEvent/LLMResponse objects, validating structured output with local JSON Schema, and never exposing API keys or raw provider responses.

Frequently Asked Questions about llm-provider-contract

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I standardize LLM provider calls across multiple models without leaking secrets into business code?

Standardize LLM provider calls by routing every request through a unified adapter contract that enforces common shapes for requests, responses, and errors, while applying strict secret redaction to prevent API keys from leaking into business logic.

How does streaming normalization handle structured output and JSON Schema validation?

Streaming normalization converts provider streams into consistent events and requires local JSON Schema validation before accepting structured output, ensuring tool-use compatibility and preventing malformed data from breaking downstream execution flows.

What is the best way to implement capability-aware fallback and retry policies for multi-provider LLM backends?

Implement capability-aware fallback by defining timeout, retry, and rate-limit boundaries within the provider adapter contract, ensuring cancellation-aware behavior and normalized SafeLLMError handling across multi-provider LLM backends.

Do I need a provider registry to manage timeout and rate-limit boundaries for LLM integrations?

Yes, a provider and model registry is required to configure timeout and rate-limit boundaries, enabling the adapter contract to correctly apply cancellation-aware retry policies and route calls safely across different LLM providers.

Why does my multi-provider LLM integration fail when switching between streaming and structured output formats?

Multi-provider LLM integrations fail without streaming normalization and local JSON Schema validation, which standardize provider-specific stream events and guardrail structured data before it enters your child-agent execution flows.

Can I use this provider adapter contract to add observability and tracing to LLM tool-use flows?

Yes, the provider adapter contract includes tracing requirements and error normalization, enabling observability across planning and child-agent execution flows by emitting normalized LLMStreamEvent objects for every tool-use interaction.