Providers
Providers are the bridge between BindAI and large language models. A provider implements the communication layer for a specific AI service, translating BindAI requests into the format expected by the underlying model and converting responses back into BindAI objects. Because every provider implements the same interface, switching models requires little or no application code changes.What is a Provider?
A provider is responsible for:- sending prompts to an AI model
- receiving model responses
- streaming tokens
- executing tool/function calling
- reporting token usage
- returning structured outputs
ModelProvider abstraction rather than provider-specific SDKs.
Supported Providers
BindAI is designed to support multiple providers. Current providers include:- OpenAI
- Ollama
- Anthropic (planned)
- Google Gemini (planned)
- Azure OpenAI (planned)
- OpenRouter (planned)
- Groq (planned)
- Together AI (planned)
Creating a Provider
Most providers can be created directly.Provider Configuration
Providers are configured using aProviderConfiguration.
Typical configuration includes:
- API key
- model
- base URL
- timeout
- organization
- custom headers
Environment Variables
Most providers support loading configuration from environment variables. Example:Supported Features
Depending on the provider, BindAI supports:
Some providers may support additional capabilities in future releases.
Streaming
Providers support token streaming.Tool Calling
Providers can return tool requests generated by the language model. Example flow:ToolCall objects.
Structured Output
Providers can return structured data instead of plain text.Token Usage
Providers report token consumption whenever available. Example:- monitoring costs
- analytics
- optimization
Switching Providers
One of BindAI’s goals is provider independence. Changing providers usually requires only replacing the provider object. OpenAI:Custom Providers
Any custom provider can integrate with BindAI by implementing theModelProvider interface.
A provider should implement methods such as:
generate()stream()capabilities
Capabilities
Every provider exposes its supported capabilities. Example:- streaming
- structured output
- tool calling
- vision
- embeddings
Provider Architecture
The provider layer sits between the execution engine and the AI service.Best Practices
- Store API keys in environment variables.
- Reuse provider instances when possible.
- Choose models appropriate for the task.
- Enable streaming for long responses.
- Monitor token usage in production.
- Prefer the provider abstraction instead of calling SDKs directly.
