ferrin-spec
Ferrin provider specification: the traits every provider implements and the types they exchange with the core.
- Model interfaces:
LanguageModel(do_generate/do_stream),EmbeddingModel,ImageModel,SpeechModel,TranscriptionModel,RerankingModel,VideoModel,SpeechTranslationModel,RealtimeModelandRealtimeFactory; servicesFiles,SkillsandBatch; theProvidertrait that hands them out by model id. - Object-safe
Dyn*counterparts and theModelRef/ServiceRefhandles (LanguageModelRef,EmbeddingModelRef, ...) accepted by the core entry points. - Wire-level data model:
Promptand content parts,CallOptions,ToolDefinition,Content,StreamPart,GenerateResult,Usage,FinishReason,Warning,Headers,ProviderOptions/ProviderMetadata, newtype identifiers and the error types (ProviderError,ApiCallError,TypeValidationError, ...). SPEC_VERSION: the specification version, equal to the crate version (ADR 0011).
Async trait methods are written as fn name(..) -> impl Future<..> + Send;
implementations may use async fn.
Part of the Ferrin workspace. Design:
docs/01-architecture/03-core-data-model.md,
docs/01-architecture/04-provider-spec.md,
docs/02-api/02-api-reference.md.
License
Apache-2.0. See LICENSE and NOTICE. Portions of this crate are derived from the Vercel AI SDK (Apache-2.0); the crate and module documentation carry the attribution.