@runcrate/ai package is a Runcrate provider for the Vercel AI SDK. Use it to build AI-powered applications with generateText, streamText, generateImage, structured output, and tool calling — all backed by Runcrate’s 140+ open-source models.
Installation
ai v6+ and Node.js 18+.
Quick Start
RUNCRATE_API_KEY environment variable, or pass apiKey directly when creating the provider.
Configuration
Text Generation
Basic
Streaming
Chat Messages
Structured Output
Image Generation
Embeddings
Model Methods
| Method | Returns | Description |
|---|---|---|
runcrate(modelId) | LanguageModel | Chat model (shorthand for chatModel) |
runcrate.chatModel(modelId) | LanguageModel | Chat model for generateText, streamText |
runcrate.completionModel(modelId) | LanguageModel | Completion model |
runcrate.imageModel(modelId) | ImageModel | Image generation model for generateImage |
runcrate.embeddingModel(modelId) | EmbeddingModel | Embedding model for embed, embedMany |
When to Use Which SDK
| SDK | Best For |
|---|---|
@runcrate/ai | Next.js/React apps using the Vercel AI SDK — useChat, streamText, generateImage |
@runcrate/sdk | Full platform access — instances, storage, billing, and inference in one client |
| OpenAI SDK | Drop-in compatibility — just change the base URL |