Provider Configuration
Overview
Pay-i supports various GenAI Providers that offer capabilities beyond just language models. The table below provides an overview of the supported providers:
Provider | Integration Type | Detailed Documentation |
---|---|---|
OpenAI | Auto-Instrumented | OpenAI Configuration |
Azure OpenAI | Auto-Instrumented | Azure OpenAI Configuration |
Anthropic | Auto-Instrumented | Anthropic Configuration |
AWS Bedrock | Auto-Instrumented | AWS Bedrock Configuration |
LangChain | Callback Handler | LangChain Configuration |
The first four providers (OpenAI, Azure OpenAI, Anthropic, and AWS Bedrock) are directly instrumented by the payi_instrument()
function, which patches their API calls automatically.
LangChain uses a different approach with a custom callback handler that captures usage information after calls complete, rather than being directly instrumented.
These providers support a range of GenAI capabilities including:
- Text Generation & Chat: Generate coherent text and hold interactive conversations
- Embeddings: Create vector representations of text for semantic similarity and search
- Knowledge Retrieval: Retrieve and use information from external sources (including RAG implementations)
- Image Generation: Create images from text descriptions
- Vision & Image Analysis: Process and analyze image content
- Speech Processing: Convert between text and speech
- Multimodal Processing: Work with multiple types of data (text, images, audio) simultaneously
For a complete and up-to-date list of all supported models and Resources for each Provider, refer to the Pay-i Managed Categories and Resources documentation.
Auto-Instrumentation Overview
Pay-i's Python SDK provides automatic instrumentation for these providers through the payi_instrument()
function. When enabled, the SDK intercepts API calls to the providers and tracks usage metrics without requiring code changes to your application's core logic.
To enable auto-instrumentation for any of the supported providers:
from payi.lib.instrument import payi_instrument
# Enable instrumentation for all supported providers
payi_instrument()
# Enable instrumentation for specific providers only
payi_instrument(instruments={"openai", "anthropic"})
Refer to the provider-specific configuration pages linked in the table above for detailed instructions on configuring each provider, including:
- Required dependencies
- SDK version compatibility
- Model-specific configuration
- Special features or limitations
- Code examples
Custom Provider Configuration
If you need to work with a provider that isn't directly supported by Pay-i's auto-instrumentation, you can:
- Use the REST Ingest API or Python SDK Ingest API to explicitly submit usage data
- Define Custom Categories and Resources to track your custom provider's usage
Related Documentation
- payi_instrument() Function - Core function for enabling auto-instrumentation
- Pay-i Client API Classes - Client libraries for interacting with Pay-i
- Custom Categories and Resources - Setting up tracking for custom models
Updated 2 days ago