ModelMetadata

org.llm4s.model.ModelMetadata
See theModelMetadata companion object
case class ModelMetadata(modelId: String, provider: String, mode: ModelMode, maxInputTokens: Option[Int], maxOutputTokens: Option[Int], inputCostPerToken: Option[Double], outputCostPerToken: Option[Double], capabilities: ModelCapabilities, pricing: ModelPricing, deprecationDate: Option[String])

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
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def contextWindow: Option[Int]

Get the effective context window size. Prefers maxInputTokens, falls back to maxOutputTokens if available.

Get the effective context window size. Prefers maxInputTokens, falls back to maxOutputTokens if available.

Attributes

def description: String

Get a human-readable description of the model.

Get a human-readable description of the model.

Attributes

def isDeprecated: Boolean

Check if the model is deprecated.

Check if the model is deprecated.

Attributes

def reserveCompletion: Option[Int]

Get the reserve completion tokens (output capacity).

Get the reserve completion tokens (output capacity).

Attributes

def supports(capability: String): Boolean

Check if this model supports a specific capability.

Check if this model supports a specific capability.

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product