org.llm4s.model
Members list
Type members
Classlikes
Default implementation that uses ModelRegistry for capability lookups.
Default implementation that uses ModelRegistry for capability lookups.
Value parameters
- overrides
-
Optional map of model-specific capability overrides
Attributes
- Supertypes
Model capabilities and features.
Model capabilities and features.
Value parameters
- disallowedParams
-
Set of parameter names that are not supported by this model
- supportedRegions
-
List of supported deployment regions
- supportsAssistantPrefill
-
Whether the model supports assistant message prefill
- supportsAudioInput
-
Whether the model supports audio inputs
- supportsAudioOutput
-
Whether the model supports audio outputs
- supportsComputerUse
-
Whether the model supports computer use
- supportsFunctionCalling
-
Whether the model supports function/tool calling
- supportsNativeStreaming
-
Whether the model supports native streaming (false = needs fake streaming)
- supportsParallelFunctionCalling
-
Whether the model supports parallel tool calls
- supportsPdfInput
-
Whether the model supports PDF file inputs
- supportsPromptCaching
-
Whether the model supports prompt caching
- supportsReasoning
-
Whether the model supports reasoning (O-series, Claude thinking)
- supportsResponseSchema
-
Whether the model supports structured response schemas
- supportsSystemMessages
-
Whether the model supports system messages (false for some O-series)
- supportsToolChoice
-
Whether the model supports tool_choice parameter
- supportsVision
-
Whether the model supports vision/image inputs
- supportsWebSearch
-
Whether the model supports web search
- temperatureConstraint
-
Temperature constraint: None = any, Some((min, max)) = restricted range
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
ModelCapabilities.type
Comprehensive metadata for an LLM model. Based on litellm's model_prices_and_context_window.json schema.
Comprehensive metadata for an LLM model. Based on litellm's model_prices_and_context_window.json schema.
This provides a centralized, type-safe representation of model capabilities, pricing, and constraints that can be queried at runtime.
Value parameters
- capabilities
-
Model capabilities and features
- deprecationDate
-
Optional deprecation date (YYYY-MM-DD)
- inputCostPerToken
-
Cost per input token (in dollars)
- maxInputTokens
-
Maximum input tokens supported
- maxOutputTokens
-
Maximum output tokens supported
- mode
-
The model mode (chat, embedding, image_generation, etc.)
- modelId
-
The unique identifier for this model (e.g., "gpt-4o", "claude-3-7-sonnet-latest")
- outputCostPerToken
-
Cost per output token (in dollars)
- pricing
-
Detailed pricing information
- provider
-
The LLM provider (openai, anthropic, azure, etc.)
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
ModelMetadata.type
Model operation mode.
Model operation mode.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
object AudioSpeechobject AudioTranscriptionobject Chatobject Completionobject Embeddingobject ImageGenerationobject Moderationobject Rerankobject Searchobject UnknownShow all
Detailed pricing information for a model.
Detailed pricing information for a model.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
ModelPricing.type
Central registry for LLM model metadata.
Central registry for LLM model metadata.
This provides a singleton lookup service for model capabilities, pricing, and constraints. It loads data from the embedded litellm metadata file and supports runtime updates from external sources.
Example usage:
val metadata = ModelRegistry.lookup("gpt-4o")
metadata.foreach { m =>
println(s"Context window: $${m.contextWindow}")
println(s"Supports vision: $${m.supports("vision")}")
}
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ModelRegistry.type
Handles model-specific parameter validation and transformation.
Handles model-specific parameter validation and transformation.
Uses ModelCapabilities from ModelRegistry to apply constraints based on what each model supports. This mirrors LiteLLM's approach to handling model-specific quirks (e.g., O-series temperature restrictions).
Example usage:
val transformer = RequestTransformer.default
val result = transformer.transformOptions("o1", options, dropUnsupported = true)
result match {
case Right(transformed) => // use transformed options
case Left(error) => // handle validation error
}
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
RequestTransformer.type
Transformation result containing both transformed options and any warnings.
Transformation result containing both transformed options and any warnings.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
TransformationResult.type