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:
|
provider |
Provider name (openai, anthropic, ollama, etc.).
TYPE:
|
context_window |
Maximum context window size.
TYPE:
|
max_output_tokens |
Maximum output tokens.
TYPE:
|
supports_tools |
Whether the model supports tool calling.
TYPE:
|
supports_vision |
Whether the model supports images.
TYPE:
|
supports_streaming |
Whether streaming is supported.
TYPE:
|
default_temperature |
Default temperature setting.
TYPE:
|
cost_per_1k_input |
Cost per 1000 input tokens (USD).
TYPE:
|
cost_per_1k_output |
Cost per 1000 output tokens (USD).
TYPE:
|
extra |
Additional provider-specific settings.
TYPE:
|
get_profile
¶
get_profile(model_name: str) -> ModelProfile
Get a profile for a model.
| PARAMETER | DESCRIPTION |
|---|---|
model_name
|
Model name or identifier.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ModelProfile
|
ModelProfile for the model, or default profile if unknown. |