Forge documentation
Providers

Provider contract

Configure real model implementations and verify capabilities.

A provider reference identifies a route. A concrete model implementation executes inference. Registering a provider or displaying it in a selector does not establish that credentials, model availability or streaming behavior are working.

Provider families

FamilyRust source
Direct HTTP modelsOpenAI, Anthropic, Google
Hosted platformsPlatform adapters
Coding productsCoding adapters
Session-backed providersSession adapters
LiteLLMLiteLLM

The aggregate has explicit provider feature flags. Native HTTP clients may be unavailable on WASM targets. The language catalog identifies corresponding model and registry APIs for other SDKs.

Rust Anthropic construction

This function builds a native model from caller-supplied credentials and a model ID verified against the provider's current catalog. It does not execute a request.

use forge_provider_anthropic::{AnthropicConfig, AnthropicError, AnthropicLanguageModel};

fn model(api_key: String, model_id: String) -> Result<AnthropicLanguageModel, AnthropicError> {
    AnthropicLanguageModel::new(
        AnthropicConfig::new(api_key).with_model(model_id)
    )
}

AnthropicConfig::new and with_model are actual APIs. The old from_env and with_default_model examples did not match source. Endpoint defaults exist and can be configured; no blanket claim of zero hard-coded URLs applies.

Release checks

Verify authentication, text output, tool calls, streaming, structured output, cancellation, usage reporting and retry behavior for the selected provider. Never turn a missing credential or unavailable model into a successful empty output.

On this page