Architecture Overview
Supported Providers
Rowboat supports six provider types through a unified configuration:Configuration System
Model Configuration Schema
Model Configuration Schema
Location: Example Configurations:
~/.rowboat/config/models.jsonSchema:Configuration Repository
Configuration Repository
Purpose: Manage LLM configuration persistenceImplementation:Location:
core/src/models/repo.tsProvider Creation
The
createProvider function wraps Vercel AI SDK’s provider factories with Rowboat’s configuration schema.Usage in Agents
Agent Runtime Integration
Agent Runtime Integration
How agents use models:Streaming responses:Tool calling:
Model Testing
Rowboat includes a connection testing function to validate model configurations before use.
Models.dev Integration
Model Catalog
Model Catalog
Purpose: Fetch and cache available models from OpenAI, Anthropic, and GoogleLocation:
~/.rowboat/config/models.dev.jsonProcess:- Fetch from https://models.dev API
- Cache response locally
- Filter by provider (OpenAI, Anthropic, Google only)
- Display in UI for model selection
Provider-Specific Notes
OpenAI
OpenAI
Models: GPT-4, GPT-4 Turbo, GPT-3.5 TurboConfiguration:Features:
- Function calling
- Streaming
- Vision (GPT-4V)
- JSON mode
Anthropic (Claude)
Anthropic (Claude)
Models: Claude 3 Opus, Claude 3 Sonnet, Claude 3 HaikuConfiguration:Features:
- Tool use
- Streaming
- 200K context window
- System prompts
Google (Gemini)
Google (Gemini)
Models: Gemini Pro, Gemini UltraConfiguration:Features:
- Function calling
- Streaming
- Multimodal (text + images)
Ollama (Local)
Ollama (Local)
Models: Llama 2, Mistral, CodeLlama, etc.Configuration:Special Handling:
- No API key required
- baseURL automatically appends
/api - Longer timeout (60s vs 8s)
- Must have Ollama running locally
OpenRouter
OpenRouter
Purpose: Route to 100+ models from multiple providersConfiguration:Features:
- Unified pricing
- Fallback routing
- Load balancing
- No rate limits
Vercel AI Gateway
Vercel AI Gateway
Purpose: Load balancing, caching, and observabilityConfiguration:Features:
- Request caching
- Load balancing across providers
- Usage analytics
- Rate limiting
Error Handling
Performance Considerations
Timeout Configuration
Timeout Configuration
- Cloud providers (OpenAI, Anthropic, Google): 8-second timeout
- Local providers (Ollama): 60-second timeout
- Custom providers: Configurable via
testModelConnection
Streaming for UX
Streaming for UX
Use streaming for long responses to improve perceived performance:
Caching Strategies
Caching Strategies
- Model catalog: Cached locally, refreshed on demand
- Configuration: Loaded once at startup, reloaded on change
- Provider instances: Cached per issuer:clientId
Code References
- Provider Factory:
core/src/models/models.ts:15 - Configuration Repo:
core/src/models/repo.ts:20 - Model Testing:
core/src/models/models.ts:71 - Models.dev Integration:
core/src/models/models-dev.ts