AISDK
An open-source Rust library for building AI-powered applications, inspired by the Vercel AI SDK. It provides a type-safe interface for interacting with Large Language Models (LLMs).
⚠️ Early Stage Warning: This project is in very early development and not ready for production use. APIs may change significantly, and features are limited. Use at your own risk.
Key Features
- OpenAI Provider Support: Initial support for OpenAI models with text generation and streaming.
- Type-Safe API: Built with Rust's type system for reliability.
- Asynchronous: Uses Tokio for async operations.
- Prompt Templating: Filesystem-based prompts using Tera templates (coming soon).
Installation
Add aisdk to your Cargo.toml:
[]
= "0.1.0"
Enable the OpenAI feature:
= { = "0.1.0", = ["openai"] }
Usage
Basic Text Generation
use ;
async
Streaming Text Generation
use ;
use StreamExt;
async
Technologies Used
- Rust: Core language.
- Tokio: Async runtime.
- Tera: Template engine for prompts.
- async-openai: OpenAI API client.
Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
License
Licensed under the MIT License. See LICENSE for details.