Vercel AI SDK Integration
Integration Status: In Progress - This integration is currently under development. The PR is pending merge: vercel/ai#8976
Integration Preview
See how 0G integrates with the Vercel AI SDK for modern web applications:

Overview
The Vercel AI SDK is a React-first framework for building conversational user interfaces with streaming capabilities and full type safety. The 0G integration brings decentralized compute to modern web applications.What is Vercel AI SDK?
The Vercel AI SDK is designed for building AI-powered applications with:- React Integration: Built-in hooks for chat interfaces and streaming
- Type Safety: Full TypeScript support with proper type inference
- Streaming: Real-time response streaming for better UX
- Edge Runtime: Optimized for Vercel’s edge functions and serverless
Installation
Once the integration is merged, you’ll be able to install it with:Supported Models
Model | Provider Address | Best For |
---|---|---|
llama-3.3-70b-instruct | 0xf07240Efa67755B5311bc75784a061eDB47165Dd | General conversations, content generation |
deepseek-r1-70b | 0x3feE5a4dd5FDb8a32dDA97Bed899830605dBD9D3 | Complex reasoning, analysis, problem-solving |
Basic Usage
Simple Text Generation
Streaming Text Generation
React Integration
Chat Interface with useChat Hook
API Route Implementation
Advanced Features
Tool Usage
Build AI applications that can use tools and function calling:Multi-Modal Support
Work with different types of content:Structured Output
Generate structured data with type safety:Streaming Patterns
Server-Sent Events
Custom Streaming Hook
Configuration Options
Model Selection
Network Settings
Migration from OpenAI
Migrating from OpenAI to 0G is straightforward:Deployment
Vercel Deployment
Environment Variables
Benefits of 0G + Vercel AI SDK
React-First Design
Built specifically for React applications with hooks and components
Type Safety
Full TypeScript support with proper type inference and validation
Edge Optimization
Optimized for Vercel’s edge runtime and serverless functions
Decentralized Compute
No dependency on centralized AI providers
Example Applications
AI-Powered Blog
Real-time Code Assistant
Getting Started
- Wait for the integration to be merged - Track progress at vercel/ai#8976
- Install the package once available:
npm install @ai-sdk/nebula
- Set up your environment with your 0G private key
- Choose your model based on your use case
- Start building modern AI applications with React!
Community & Support
- GitHub: vercel/ai
- Vercel AI SDK Docs: sdk.vercel.ai
- 0G Discord: Join for integration-specific support
- Examples: Check the integration repository for more examples once merged