diff --git a/.env.template b/.env.template index 13e252ca..ee0bd6b6 100644 --- a/.env.template +++ b/.env.template @@ -12,6 +12,9 @@ ASKUI_WORKSPACE_ID= # OpenRouter OPEN_ROUTER_API_KEY= +# Models +VLM_PROVIDER_MODEL_ID= + # Telemetry ASKUI__VA__TELEMETRY__ENABLED=True # Set to "False" to disable telemetry diff --git a/docs/04_using_models.md b/docs/04_using_models.md index f1e840b2..97ca694b 100644 --- a/docs/04_using_models.md +++ b/docs/04_using_models.md @@ -18,14 +18,19 @@ with ComputerAgent() as agent: ## Configuring Model IDs -If you want to use another model, you select one of the available ones and set is through overriding the model_id in the provider: +If you want to use another model, you select one of the available ones and set as an environment variable (**currently only supported for vlm_provider!**): +``` +VLM_PROVIDER_MODEL_ID=claude-opus-4-6 +``` + +Alternatively, you can also set it through overriding the model_id in the provider: ```python from askui import AgentSettings, ComputerAgent from askui.model_providers import AskUIVlmProvider, AskUIImageQAProvider with ComputerAgent(settings=AgentSettings( - vlm_provider=AskUIVlmProvider(model_id="claude-opus-4-5-20251101"), + vlm_provider=AskUIVlmProvider(model_id="claude-opus-4-6"), image_qa_provider=AskUIImageQAProvider(model_id="gemini-2.5-pro"), )) as agent: agent.act("Complete the checkout process") @@ -34,11 +39,11 @@ with ComputerAgent(settings=AgentSettings( The following models are available with your AskUI credentials through the AskUI API: **VLM Provider** (for `act()`): Claude models via AskUI's Anthropic proxy -- `claude-haiku-4-5-20251001` -- `claude-sonnet-4-5-20250929` (default) +- `claude-haiku-4-5-20251001` (most cost efficient) +- `claude-sonnet-4-5-20250929` - `claude-opus-4-5-20251101` -- `claude-opus-4-6`(coming soon!) -- `claude-sonnet-4-6`(coming soon!) +- `claude-sonnet-4-6`(default) +- `claude-opus-4-6` (most capable) **Image Q&A Provider** (for `get()`): Gemini models via AskUI's Gemini proxy diff --git a/docs/05_bring_your_own_model_provider.md b/docs/05_bring_your_own_model_provider.md index bb4a1e48..66cb5013 100644 --- a/docs/05_bring_your_own_model_provider.md +++ b/docs/05_bring_your_own_model_provider.md @@ -58,7 +58,7 @@ from askui.model_providers import AnthropicVlmProvider with ComputerAgent(settings=AgentSettings( vlm_provider=AnthropicVlmProvider( - model_id="claude-sonnet-4-5-20251101", + model_id="claude-opus-4-6", ), )) as agent: agent.act("Navigate to settings") diff --git a/src/askui/agent_settings.py b/src/askui/agent_settings.py index 10f48ce2..68553c35 100644 --- a/src/askui/agent_settings.py +++ b/src/askui/agent_settings.py @@ -153,7 +153,7 @@ class AgentSettings: from askui.model_providers import AskUIVlmProvider, AskUIImageQAProvider agent = ComputerAgent(settings=AgentSettings( - vlm_provider=AskUIVlmProvider(model_id=\"claude-opus-4-5-20251101\"), + vlm_provider=AskUIVlmProvider(model_id=\"claude-opus-4-6\"), image_qa_provider=AskUIImageQAProvider(model_id=\"gemini-2.5-pro\"), )) ``` diff --git a/src/askui/model_providers/anthropic_vlm_provider.py b/src/askui/model_providers/anthropic_vlm_provider.py index 05b9a3dd..b0e5d186 100644 --- a/src/askui/model_providers/anthropic_vlm_provider.py +++ b/src/askui/model_providers/anthropic_vlm_provider.py @@ -1,5 +1,6 @@ """AnthropicVlmProvider — VLM access via direct Anthropic API.""" +import os from functools import cached_property from typing import Any @@ -34,7 +35,7 @@ class AnthropicVlmProvider(VlmProvider): auth_token (str | None, optional): Authorization token for custom authentication. Added as an `Authorization` header. model_id (str, optional): Claude model to use. Defaults to - `\"claude-sonnet-4-5-20251101\"`. + `\"claude-sonnet-4-6\"`. client (Anthropic | None, optional): Pre-configured Anthropic client. If provided, other connection parameters are ignored. @@ -57,10 +58,12 @@ def __init__( api_key: str | None = None, base_url: str | None = None, auth_token: str | None = None, - model_id: str = _DEFAULT_MODEL_ID, + model_id: str | None = None, client: Anthropic | None = None, ) -> None: - self._model_id_value = model_id + self._model_id_value = ( + model_id or os.environ.get("VLM_PROVIDER_MODEL_ID") or _DEFAULT_MODEL_ID + ) if client is not None: self.client = client else: diff --git a/src/askui/model_providers/askui_vlm_provider.py b/src/askui/model_providers/askui_vlm_provider.py index bf37cb46..5dfc9d29 100644 --- a/src/askui/model_providers/askui_vlm_provider.py +++ b/src/askui/model_providers/askui_vlm_provider.py @@ -1,5 +1,6 @@ """AskUIVlmProvider — VLM access via AskUI's hosted Anthropic proxy.""" +import os from functools import cached_property from typing import Any @@ -33,7 +34,7 @@ class AskUIVlmProvider(VlmProvider): token (str | None, optional): AskUI API token. Reads `ASKUI_TOKEN` from the environment if not provided. model_id (str, optional): Claude model to use. Defaults to - `"claude-sonnet-4-5-20250929"`. + `"claude-sonnet-4-6"`. client (Anthropic | None, optional): Pre-configured Anthropic client. If provided, `workspace_id` and `token` are ignored. @@ -55,17 +56,19 @@ class AskUIVlmProvider(VlmProvider): def __init__( self, askui_settings: AskUiInferenceApiSettings | None = None, - model_id: str = _DEFAULT_MODEL_ID, + model_id: str | None = None, client: Anthropic | None = None, ) -> None: self._askui_settings = askui_settings or AskUiInferenceApiSettings() - self._model_id = model_id + self._model_id_value = ( + model_id or os.environ.get("VLM_PROVIDER_MODEL_ID") or _DEFAULT_MODEL_ID + ) self._injected_client = client @property @override def model_id(self) -> str: - return self._model_id + return self._model_id_value @cached_property def _messages_api(self) -> AnthropicMessagesApi: @@ -100,7 +103,7 @@ def create_message( ) -> MessageParam: result: MessageParam = self._messages_api.create_message( messages=messages, - model_id=self._model_id, + model_id=self._model_id_value, tools=tools, max_tokens=max_tokens, system=system,