From d93296486c6199876413a72e939322dbabb5cc68 Mon Sep 17 00:00:00 2001 From: citizen204 Date: Mon, 29 Jun 2026 04:30:34 +0930 Subject: [PATCH 1/2] docs(anthropic): add preset config and expand README setup instructions; fix max_tokens - Add `anthropic` preset to llm-config.defaults.jsonc (claude-sonnet-4-6 + claude-haiku-4-5-20251001 fallback), matching the existing minimax preset so users can copy it into their override config in one step. - Expand the README Anthropic section from a bare NOTE into a full setup guide (step-by-step, like the MiniMax section). - Set max_tokens=8192 in get_anthropic_llm: LangChain's ChatAnthropic defaults to 1024, which is too short for agent plans that describe full phone-automation sequences and can cause mid-response truncation. Co-Authored-By: Claude Sonnet 4.6 --- README.md | 12 ++++-- llm-config.defaults.jsonc | 62 ++++++++++++++++++++++++++++++ minitap/mobile_use/services/llm.py | 1 + 3 files changed, 72 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3a445a5..8a5033a 100644 --- a/README.md +++ b/README.md @@ -96,9 +96,15 @@ Follow our [Platform quickstart](https://docs.minitap.ai/mobile-use-sdk/platform Available models: `MiniMax-M2.7` (200K context, recommended), `MiniMax-M2.7-highspeed` (200K context, faster inference). - > [!NOTE] - > If you want to use Anthropic Claude, set `ANTHROPIC_API_KEY` in your `.env`. - > + **Using Anthropic Claude:** + + [Anthropic](https://www.anthropic.com/) provides Claude — a capable, safety-focused model family. To use it: + + 1. Set `ANTHROPIC_API_KEY` in your `.env` + 2. Copy the contents of the `anthropic` preset object from `llm-config.defaults.jsonc` into your `llm-config.override.jsonc`, or set `"provider": "anthropic"` on individual agent nodes. + + Available models: `claude-sonnet-4-6` (200K context, recommended), `claude-haiku-4-5-20251001` (200K context, faster/cheaper). + > [!NOTE] > If you want to use Google Vertex AI, you must either: > diff --git a/llm-config.defaults.jsonc b/llm-config.defaults.jsonc index 2f6987e..442aedf 100644 --- a/llm-config.defaults.jsonc +++ b/llm-config.defaults.jsonc @@ -71,6 +71,68 @@ // } } }, + // Anthropic preset – uses Claude Sonnet 4.6 (capable, 200k context) with Haiku 4.5 as a + // fast/cheap fallback. To use it, copy the contents of this object into llm-config.override.jsonc. + "anthropic": { + "planner": { + "provider": "anthropic", + "model": "claude-sonnet-4-6", + "fallback": { + "provider": "anthropic", + "model": "claude-haiku-4-5-20251001" + } + }, + "orchestrator": { + "provider": "anthropic", + "model": "claude-sonnet-4-6", + "fallback": { + "provider": "anthropic", + "model": "claude-haiku-4-5-20251001" + } + }, + "cortex": { + "provider": "anthropic", + "model": "claude-sonnet-4-6", + "fallback": { + "provider": "anthropic", + "model": "claude-haiku-4-5-20251001" + } + }, + "executor": { + "provider": "anthropic", + "model": "claude-haiku-4-5-20251001", + "fallback": { + "provider": "anthropic", + "model": "claude-sonnet-4-6" + } + }, + "contextor": { + "provider": "anthropic", + "model": "claude-haiku-4-5-20251001", + "fallback": { + "provider": "anthropic", + "model": "claude-sonnet-4-6" + } + }, + "utils": { + "hopper": { + "provider": "anthropic", + "model": "claude-sonnet-4-6", + "fallback": { + "provider": "anthropic", + "model": "claude-haiku-4-5-20251001" + } + }, + "outputter": { + "provider": "anthropic", + "model": "claude-haiku-4-5-20251001", + "fallback": { + "provider": "anthropic", + "model": "claude-sonnet-4-6" + } + } + } + }, // MiniMax preset – uses MiniMax M2.7 and M2.7-highspeed (200k context). // To use it, copy the contents of this object into llm-config.override.jsonc. "minimax": { diff --git a/minitap/mobile_use/services/llm.py b/minitap/mobile_use/services/llm.py index 735f6a8..6b843b9 100644 --- a/minitap/mobile_use/services/llm.py +++ b/minitap/mobile_use/services/llm.py @@ -145,6 +145,7 @@ def get_anthropic_llm( model_name=model_name, api_key=settings.ANTHROPIC_API_KEY, temperature=temperature, + max_tokens=8192, max_retries=2, timeout=None, stop=None, From 334e3791232c46d40db044410fcc37b2ad274bfa Mon Sep 17 00:00:00 2001 From: citizen204 Date: Wed, 1 Jul 2026 04:23:20 +0930 Subject: [PATCH 2/2] fix(llm): silence pyright call-arg on Anthropic max_tokens ChatAnthropic exposes the output-token limit via a field named max_tokens that is aliased to max_tokens_to_sample, so the synthesized __init__ only advertises the alias and pyright flags max_tokens=8192 as reportCallIssue. Pass the value by its public name (matching the Anthropic API parameter and langchain-anthropic's own integration tests) and add a type: ignore[call-arg], which is the same convention used elsewhere in this repo. --- minitap/mobile_use/services/llm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/minitap/mobile_use/services/llm.py b/minitap/mobile_use/services/llm.py index 6b843b9..900bf60 100644 --- a/minitap/mobile_use/services/llm.py +++ b/minitap/mobile_use/services/llm.py @@ -145,7 +145,7 @@ def get_anthropic_llm( model_name=model_name, api_key=settings.ANTHROPIC_API_KEY, temperature=temperature, - max_tokens=8192, + max_tokens=8192, # type: ignore[call-arg] # field aliased to max_tokens_to_sample max_retries=2, timeout=None, stop=None,