Skip to main content

Crate aimux_core

Crate aimux_core 

Source
Expand description

§aimux-core

Core abstractions for the aimux toolkit.

Architecture (aligned with Vercel AI SDK V4):

  User-facing API          Provider-facing trait
  ──────────────           ─────────────────────
  generate_text()  ──►     LanguageModel::do_generate()
  stream_text()    ──►     LanguageModel::do_stream()

The user calls generate_text / stream_text (free functions). These convert user messages into LanguageModelPrompt, build CallOptions, and call LanguageModel::do_generate / do_stream on the provider implementation.

Re-exports§

pub use embedding_model::EmbeddingModel;
pub use error::AiMuxError;
pub use files_model::Files;
pub use image_model::ImageModel;
pub use language_model::LanguageModel;
pub use provider::Provider;
pub use reranking_model::RerankingModel;
pub use search_model::SearchModel;
pub use speech_model::SpeechModel;
pub use transcription_model::TranscriptionModel;
pub use video_model::VideoModel;

Modules§

content
Content parts shared between user-facing and provider-facing messages.
embedding_model
The EmbeddingModel trait — the provider-facing interface for text embeddings.
error
Error types for aimux-core.
files_model
The Files trait — the provider-facing interface for file management.
generate
User-facing API: generate_text and stream_text.
image_model
The ImageModel trait — the provider-facing interface for image generation.
json_repair
JSON repair and partial-JSON parsing helpers.
language_model
The LanguageModel trait — the provider-facing interface.
language_model_message
Provider-facing message types.
math
Math helpers ported from the Vercel AI SDK TypeScript util package.
message
User-facing message types.
model_id
Model identifier helpers.
options
CallOptions — the provider-facing options passed to do_generate / do_stream.
prelude
Convenience re-exports.
provider
The Provider trait — a factory that creates LanguageModel instances.
reranking_model
The RerankingModel trait — the provider-facing interface for reranking.
result
Result types for do_generate and do_stream.
search_model
The SearchModel trait — the provider-facing interface for web search.
shared
Shared V4 value types used across all non-chat model traits.
speech_model
The SpeechModel trait — the provider-facing interface for text-to-speech.
stream_part
StreamPart — the individual chunk types emitted by do_stream.
tool
Tool / function-calling types.
transcription_model
The TranscriptionModel trait — the provider-facing interface for speech-to-text.
types
Shared value types: FinishReason, Usage, Warning, ResponseMetadata.
util
Utility functions ported from the Vercel AI SDK TypeScript util package.
video_model
The VideoModel trait — the provider-facing interface for video generation.