Skip to main content
Rowboat uses the Vercel AI SDK for unified LLM integration, supporting multiple providers with a consistent interface.

Architecture Overview

Supported Providers

Rowboat supports six provider types through a unified configuration:

Configuration System

Location: ~/.rowboat/config/models.jsonSchema:
Example Configurations:
Purpose: Manage LLM configuration persistenceImplementation:
Location: core/src/models/repo.ts

Provider Creation

The createProvider function wraps Vercel AI SDK’s provider factories with Rowboat’s configuration schema.

Usage in Agents

How agents use models:
Streaming responses:
Tool calling:

Model Testing

Rowboat includes a connection testing function to validate model configurations before use.
Usage:

Models.dev Integration

Purpose: Fetch and cache available models from OpenAI, Anthropic, and GoogleLocation: ~/.rowboat/config/models.dev.jsonProcess:
  1. Fetch from https://models.dev API
  2. Cache response locally
  3. Filter by provider (OpenAI, Anthropic, Google only)
  4. Display in UI for model selection
Implementation:

Provider-Specific Notes

Models: GPT-4, GPT-4 Turbo, GPT-3.5 TurboConfiguration:
Features:
  • Function calling
  • Streaming
  • Vision (GPT-4V)
  • JSON mode
Models: Claude 3 Opus, Claude 3 Sonnet, Claude 3 HaikuConfiguration:
Features:
  • Tool use
  • Streaming
  • 200K context window
  • System prompts
Models: Gemini Pro, Gemini UltraConfiguration:
Features:
  • Function calling
  • Streaming
  • Multimodal (text + images)
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
Installation:
Purpose: Route to 100+ models from multiple providersConfiguration:
Features:
  • Unified pricing
  • Fallback routing
  • Load balancing
  • No rate limits
Purpose: Load balancing, caching, and observabilityConfiguration:
Features:
  • Request caching
  • Load balancing across providers
  • Usage analytics
  • Rate limiting

Error Handling

Always handle provider errors gracefully. Network issues, rate limits, and invalid API keys are common.

Performance Considerations

  • Cloud providers (OpenAI, Anthropic, Google): 8-second timeout
  • Local providers (Ollama): 60-second timeout
  • Custom providers: Configurable via testModelConnection
Use streaming for long responses to improve perceived performance:
  • 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