ExLLM.Adapters.Shared.ModelUtils (ex_llm v0.5.0)
View SourceShared utilities for model management across adapters.
Provides common functionality for:
- Model name formatting and normalization
- Description generation based on model characteristics
- Capability inference from model IDs
- Model categorization and filtering
Summary
Functions
Format a model ID into a human-readable name.
Generate a model description based on its ID and characteristics.
Extract model family from model ID.
Infer model capabilities from its ID and provider.
Check if a model ID indicates a chat/conversational model.
Functions
Format a model ID into a human-readable name.
Examples
iex> ModelUtils.format_model_name("gpt-4-turbo")
"GPT 4 Turbo"
iex> ModelUtils.format_model_name("claude-3-5-sonnet")
"Claude 3 5 Sonnet"
Generate a model description based on its ID and characteristics.
Examples
iex> ModelUtils.generate_description("gpt-4-turbo", :openai)
"OpenAI's GPT-4 Turbo model with improved performance"
Extract model family from model ID.
Examples
iex> ModelUtils.get_model_family("gpt-4-turbo-preview")
"gpt-4"
iex> ModelUtils.get_model_family("claude-3-5-sonnet")
"claude-3"
Infer model capabilities from its ID and provider.
Returns a map with capability flags.
Check if a model ID indicates a chat/conversational model.