Skip to content

ModelProfile

Model capability information.

Quick Example

from mamba_agents.backends import get_profile, ModelProfile

# Get profile
profile = get_profile("gpt-4o")

print(f"Context window: {profile.context_window}")
print(f"Max output: {profile.max_output_tokens}")
print(f"Supports tools: {profile.supports_tools}")
print(f"Supports vision: {profile.supports_vision}")
print(f"Provider: {profile.provider}")

Available Profiles

Model Context Tools Vision
gpt-4o 128k Yes Yes
gpt-4o-mini 128k Yes Yes
gpt-4-turbo 128k Yes Yes
gpt-3.5-turbo 16k Yes No
claude-3-5-sonnet 200k Yes Yes
claude-3-opus 200k Yes Yes
llama3.2 8k No No

API Reference

ModelProfile dataclass

ModelProfile(
    name: str,
    provider: str,
    context_window: int,
    max_output_tokens: int,
    supports_tools: bool = True,
    supports_vision: bool = False,
    supports_streaming: bool = True,
    default_temperature: float = 0.7,
    cost_per_1k_input: float | None = None,
    cost_per_1k_output: float | None = None,
    extra: dict[str, Any] = dict(),
)

Profile defining model capabilities and settings.

ATTRIBUTE DESCRIPTION
name

Model identifier.

TYPE: str

provider

Provider name (openai, anthropic, ollama, etc.).

TYPE: str

context_window

Maximum context window size.

TYPE: int

max_output_tokens

Maximum output tokens.

TYPE: int

supports_tools

Whether the model supports tool calling.

TYPE: bool

supports_vision

Whether the model supports images.

TYPE: bool

supports_streaming

Whether streaming is supported.

TYPE: bool

default_temperature

Default temperature setting.

TYPE: float

cost_per_1k_input

Cost per 1000 input tokens (USD).

TYPE: float | None

cost_per_1k_output

Cost per 1000 output tokens (USD).

TYPE: float | None

extra

Additional provider-specific settings.

TYPE: dict[str, Any]

get_profile

get_profile(model_name: str) -> ModelProfile

Get a profile for a model.

PARAMETER DESCRIPTION
model_name

Model name or identifier.

TYPE: str

RETURNS DESCRIPTION
ModelProfile

ModelProfile for the model, or default profile if unknown.

Source code in src/mamba_agents/backends/profiles.py
def get_profile(model_name: str) -> ModelProfile:
    """Get a profile for a model.

    Args:
        model_name: Model name or identifier.

    Returns:
        ModelProfile for the model, or default profile if unknown.
    """
    # Exact match
    if model_name in PROFILES:
        return PROFILES[model_name]

    # Check for partial matches (e.g., "gpt-4o-2024-05-13" matches "gpt-4o")
    for profile_name, profile in PROFILES.items():
        if model_name.startswith(profile_name):
            return profile

    # Return default profile for unknown models
    return PROFILES["default"]