{
  "name": "forge-litellm",
  "language": "rust",
  "version": "0.2.0",
  "description": "Optional LiteLLM compatibility adapter for the Forge SDK",
  "manifest": "forge-rs/crates/forge-litellm/Cargo.toml",
  "manifestSha256": "5f1c9b71d0211205553ac161708bd941c6bbce041ce380f35a73837fc561ae83",
  "status": "source-reference",
  "registryPublicationVerified": false,
  "route": "/libraries/rust/forge-litellm",
  "features": {},
  "files": [
    {
      "path": "forge-rs/crates/forge-litellm/src/error.rs",
      "sha256": "a68a8793bb1766a37d954f8df1ce5714b2eadf2b90c31625ab808a62509d09be",
      "artifactSha256": "6a9209d4ed330370541d153e9818ae7c5797e70346d1cb2c17a330d132a192be",
      "url": "/reference/source/forge-rs/crates/forge-litellm/src/error.rs.txt",
      "declarations": [
        {
          "name": "::LiteLlmError",
          "line": 9,
          "signature": "#[derive(Debug, Error)]\npub enum LiteLlmError {\n    /// The LiteLLM proxy returned an error response.\n    #[error(\"LiteLLM proxy at '{base_url}' returned error for model '{model}': {status} \u2014 {body}\")]\n    ProxyError {\n        /// The LiteLLM proxy base URL.\n        base_url: String,\n        /// The model that was requested.\n        model: String,\n        /// The HTTP status code.\n        status: u16,\n        /// The response body (truncated if large).\n        body: String,\n    },\n\n    /// The LiteLLM proxy is unreachable.\n    #[error(\"LiteLLM proxy at '{base_url}' is unreachable: {reason}\")]\n    ProxyUnreachable {\n        /// The LiteLLM proxy base URL.\n        base_url: String,\n        /// Human-readable connection error.\n        reason: String,\n    },\n\n    /// The LiteLLM proxy returned a response that could not be parsed.\n    #[error(\n        \"LiteLLM proxy at '{base_url}' returned unparseable response for model '{model}': {reason}\"\n    )]\n    InvalidResponse {\n        /// The LiteLLM proxy base URL.\n        base_url: String,\n        /// The model that was requested.\n        model: String,\n        /// What failed during parsing.\n        reason: String,\n    },\n\n    /// LiteLLM configuration is invalid.\n    #[error(\"invalid LiteLLM configuration: {reason}\")]\n    InvalidConfig {\n        /// What is wrong with the configuration.\n        reason: String,\n    },\n\n    /// A Forge core error occurred during translation.\n    #[error(\"forge core error: {0}\")]\n    ForgeCore(#[from] forge_core::error::ForgeError),\n}",
          "documentation": "Errors that can occur during LiteLLM adapter operations."
        },
        {
          "name": "::LiteLlmResult",
          "line": 58,
          "signature": "pub type LiteLlmResult<T> = Result<T, LiteLlmError>;",
          "documentation": "A specialized `Result` type for LiteLLM adapter operations."
        }
      ]
    },
    {
      "path": "forge-rs/crates/forge-litellm/src/lib.rs",
      "sha256": "e10121039823f832ff939a3a9b8adde53c758cbefa4f4edfad614030d593eec2",
      "artifactSha256": "34bdfa1863946c729431cb7e6629f7175d46331fc862e9c4a38e46b465cbe760",
      "url": "/reference/source/forge-rs/crates/forge-litellm/src/lib.rs.txt",
      "declarations": [
        {
          "name": "error",
          "line": 44,
          "signature": "pub mod error;",
          "documentation": ""
        },
        {
          "name": "model",
          "line": 46,
          "signature": "#[cfg(not(target_arch = \"wasm32\"))]\npub mod model;",
          "documentation": ""
        },
        {
          "name": "pub use error::{LiteLlmError, LiteLlmResult};",
          "line": 48,
          "signature": "pub use error::{LiteLlmError, LiteLlmResult};",
          "documentation": ""
        },
        {
          "name": "pub use model::{register_litellm_model, LiteLlmConfig, LiteLlmModel};",
          "line": 50,
          "signature": "#[cfg(not(target_arch = \"wasm32\"))]\npub use model::{register_litellm_model, LiteLlmConfig, LiteLlmModel};",
          "documentation": ""
        }
      ]
    },
    {
      "path": "forge-rs/crates/forge-litellm/src/model.rs",
      "sha256": "53c2ffb55a95b65f21ae0626c7245099ce53b20a0b9f34a8e7a6b356098134cb",
      "artifactSha256": "9fce3003077d347834278b689d2ef37e61f946fdbaf3235132a7429c6155ebbd",
      "url": "/reference/source/forge-rs/crates/forge-litellm/src/model.rs.txt",
      "declarations": [
        {
          "name": "::LiteLlmConfig",
          "line": 34,
          "signature": "#[derive(Debug, Clone)]\npub struct LiteLlmConfig {\n\n}",
          "documentation": "Configuration for connecting to a LiteLLM proxy.\n\n# Examples\n\n```\nuse forge_litellm::LiteLlmConfig;\n\nlet config = LiteLlmConfig::new(\"http://localhost:4000\", \"sk-litellm-key\");\nassert_eq!(config.base_url(), \"http://localhost:4000\");\n```"
        },
        {
          "name": "::LiteLlmConfig::new",
          "line": 47,
          "signature": "pub fn new(base_url: impl Into<String>, api_key: impl Into<String>) -> Self;",
          "documentation": "Creates a new LiteLLM configuration.\n\n# Arguments\n\n* `base_url` - The LiteLLM proxy base URL (e.g., \"http://localhost:4000\").\n* `api_key` - The API key for authenticating with the LiteLLM proxy."
        },
        {
          "name": "::LiteLlmConfig::with_timeout",
          "line": 56,
          "signature": "pub fn with_timeout(mut self, seconds: u64) -> Self;",
          "documentation": "Sets the request timeout in seconds."
        },
        {
          "name": "::LiteLlmConfig::base_url",
          "line": 62,
          "signature": "pub fn base_url(&self) -> &str;",
          "documentation": "Returns the base URL."
        },
        {
          "name": "::LiteLlmConfig::timeout_seconds",
          "line": 67,
          "signature": "pub fn timeout_seconds(&self) -> u64;",
          "documentation": "Returns the timeout in seconds."
        },
        {
          "name": "::LiteLlmConfig::validate",
          "line": 76,
          "signature": "pub fn validate(&self) -> LiteLlmResult<()>;",
          "documentation": "Validates the configuration.\n\n# Errors\n\nReturns `LiteLlmError::InvalidConfig` if the base URL is empty."
        },
        {
          "name": "::LiteLlmModel",
          "line": 158,
          "signature": "#[derive(Debug, Clone)]\npub struct LiteLlmModel {\n\n}",
          "documentation": "A `LanguageModel` implementation that routes through a LiteLLM proxy.\n\nThis adapter translates Forge model calls to LiteLLM's OpenAI-compatible\nHTTP endpoint. It is intentionally thin: no caching, no retry logic,\nno special features. The LiteLLM proxy handles routing, caching, and\nload balancing.\n\n# Examples\n\n```no_run\nuse forge_litellm::{LiteLlmConfig, LiteLlmModel};\n\nlet config = LiteLlmConfig::new(\"http://localhost:4000\", \"sk-litellm-key\");\nlet model = LiteLlmModel::new(\"gpt-4o\", config);\n// Use as any LanguageModel via the Forge provider registry\n```"
        },
        {
          "name": "::LiteLlmModel::new",
          "line": 171,
          "signature": "pub fn new(model_id: impl Into<String>, config: LiteLlmConfig) -> Self;",
          "documentation": "Creates a new LiteLLM model adapter.\n\n# Arguments\n\n* `model_id` - The model identifier as known to LiteLLM (e.g., \"gpt-4o\",\n  \"claude-3-opus\", or any model LiteLLM is configured to route).\n* `config` - The LiteLLM proxy configuration."
        },
        {
          "name": "::LiteLlmModel::model",
          "line": 179,
          "signature": "pub fn model(&self) -> &str;",
          "documentation": "Returns the model ID."
        },
        {
          "name": "::LiteLlmModel::config",
          "line": 184,
          "signature": "pub fn config(&self) -> &LiteLlmConfig;",
          "documentation": "Returns the LiteLLM config."
        },
        {
          "name": "::register_litellm_model",
          "line": 412,
          "signature": "pub fn register_litellm_model(\n    registry: &mut ProviderRegistry,\n    model_id: impl Into<String>,\n    config: LiteLlmConfig,\n) -> ForgeResult<String>;",
          "documentation": "Registers a LiteLLM-routed model in a `ProviderRegistry`.\n\nThe model is registered under the `litellm` namespace:\n`litellm:<model_id>`.\n\n# Arguments\n\n* `registry` - The provider registry to register with.\n* `model_id` - The model identifier as known to LiteLLM.\n* `config` - The LiteLLM proxy configuration.\n\n# Returns\n\nThe full provider reference string (e.g., `\"litellm:gpt-4o\"`).\n\n# Errors\n\nReturns `ForgeError` if registration fails.\n\n# Examples\n\n```no_run\nuse forge_litellm::{LiteLlmConfig, register_litellm_model};\nuse forge_core::provider::ProviderRegistry;\n\nlet mut registry = ProviderRegistry::new();\nlet config = LiteLlmConfig::new(\"http://localhost:4000\", \"sk-litellm-key\");\nlet provider_ref = register_litellm_model(&mut registry, \"gpt-4o\", config).unwrap();\nassert_eq!(provider_ref, \"litellm:gpt-4o\");\n```"
        }
      ]
    }
  ]
}
