Streamline AI integration with a unified multi-provider client for Rust.
Project details
Aiface simplifies the integration of multiple LLM providers into Rust applications, offering a type-safe API to connect to over 30 providers. With features like streaming, OAuth support, and context-window intelligence, it provides developers the tools needed to build advanced AI solutions effortlessly.
aiface is a versatile and unified multi-provider client for large language models (LLMs) in Rust. It streamlines interactions with over 30 LLM providers, including renowned names like Claude, OpenAI, Gemini, and GitHub Copilot, through a single, type-safe API. This capability allows developers to easily switch between providers, enhancing flexibility and functionality in AI applications.
Connector to access various providers seamlessly. Change the provider simply by modifying the name passed to Connector::new.generate_image function produces images via participating providers. Chat responses can also include embedded images for a more vivid interaction experience.Connector::decide contract, simplifying complex decision-making processes.The following Rust snippet demonstrates how to set up a chat connection with the OpenAI provider:
use aiface::connector::Connector;
let reply = Connector::new("openai")?
.with_model("gpt-4o")
.with_temperature(0.7)
.with_api_key("sk-...")
.chat("Explain Rust ownership")
.await?;
Comprehensive guides for all the available modules can be found in the docs/ directory. This includes sections on the connector overview, client builder API, decision models, and more. Additionally, a practical walkthrough is available in the example located at examples/client.rs.
To leverage the powerful capabilities of aiface, Rust edition 2024 or higher (≥ 1.85) is required. This project offers a streamlined approach for developers looking to integrate multiple LLMs into their applications, enhancing productivity and capabilities in AI-driven projects.
Comments
0Start the conversation
Share the first comment.