-
Notifications
You must be signed in to change notification settings - Fork 51
Closed
Description
Revert Vercel AI SDK adoption and implement clean abstraction for LLM providers
The recent adoption of the Vercel AI SDK has introduced reliability issues. We need to revert these changes and implement a cleaner abstraction for LLM providers using the Anthropic SDK directly.
Background
- PR Implement Vercel AI SDK for Anthropic Claude support #55 introduced the Vercel AI SDK for Anthropic Claude support
- Subsequent PRs added support for Ollama, OpenAI, and Grok/XAI using the Vercel AI SDK
- These changes have led to reliability problems
Tasks
- Remove dependencies on Vercel AI SDK (
ai
and@ai-sdk/*
packages) - Create our own message type system with support for:
- System messages
- User messages
- Assistant messages
- Tool use/result messages
- Implement a generic
generateText()
function that:- Takes messages, tools, and standard LLM settings
- Returns a new set of messages
- Create an Anthropic-specific implementation that:
- Takes API key and model name
- Returns a function matching the generic
generateText()
type - Handles conversion between our message format and Anthropic's format
Non-goals for this PR
- Token caching (will be added in a follow-up issue)
- Support for OpenAI, Ollama, and Grok (will be added in follow-up issues)
Benefits
- More reliable LLM integration
- Cleaner abstraction between the application and specific LLM providers
- Easier to add support for other models in the future
Metadata
Metadata
Assignees
Labels
No labels