Repository navigation
Description
Summary
Several runtime code paths instantiate a Google LLM directly via get_google_llm() instead of resolving the provider configured in config/artemis.jsonc. As a result, configuring a non-Google provider for every node (e.g. "provider": "openai" pointed at an OpenAI-compatible gateway, or "provider": "anthropic") is not sufficient to run a Flash task: the run still tries to construct ChatGoogleGenerativeAI and aborts when no Google API key is present.
The README advertises Gemini, Claude and GPT-4o support, and ModelFactory / get_llm(ctx, name=...) already handle provider selection correctly, so this looks like a handful of call sites that bypass the router rather than a design limitation.
Related: #41 (unit tests requiring Gemini credentials) is a sibling symptom on the test side.
Affected code (at 371aa6d)
| File | Line | What it does |
|---|---|---|
artemis/agents/flash/summarizer.py |
169, 173 | VisualStepSummarizer calls get_google_llm(model_name=target_model, ...) whenever a summarizer model name is configured, and again in the except fallback. Setting agent.flash.step_summarizer.model therefore forces the Google provider regardless of the rest of the config. |
artemis/memory/chunking.py |
328, 335 | StepCapsuleLens._get_llm() / _get_fallback_llm() always call get_google_llm(...) for agent.memory.chunking.model and its fallback. |
artemis/agents/flash/runner.py |
287 | Operator LLM fallback (when get_llm(ctx, name="operator") raises) is hardcoded to get_google_llm(model_name="gemini-2.5-flash"). |
artemis/config/llm.py |
120-131 | lightweight_judge_default() (pixel safety net / planner validation judges) hardcodes provider="google", and there is no artemis.jsonc key to override the judge provider. |
StepSummarizerConfig and MemoryChunkingConfig (artemis/config/agent.py) only carry a model name and no provider, which is probably why those call sites assume Google.
Steps to reproduce
- In
config/artemis.jsonc, setdefault, every entry undernodes,agent.flash.step_summarizerandagent.memory.chunkingto a non-Google provider, e.g."provider": "openai"withOPENAI_API_KEY/OPENAI_BASE_URLpointing at an OpenAI-compatible endpoint. - Leave
GEMINI_API_KEYandGOOGLE_API_KEYunset. - Run any Flash task, e.g.
uv run artemis run "Open the Settings app"(ormobile_run_taskthrough the MCP server).
Observed: the task fails while constructing ChatGoogleGenerativeAI (no API key) from the step summarizer / memory chunking / operator fallback paths, even though no node is configured to use Google.
Expected: no Google client is created when no node is configured for Google; the configured provider is honored everywhere.
Suggested fix
- Replace the direct
get_google_llm()calls insummarizer.py,chunking.pyandrunner.pywith provider-aware resolution: eitherget_llm(ctx, name=...)against a named node, orModelFactory.create_model(ModelEndpoint(provider=<configured default provider>, model=...)). - Add an optional
providerfield toStepSummarizerConfigandMemoryChunkingConfig, defaulting to thedefaultnode's provider when omitted. - Let
lightweight_judge_default()inherit the configured default provider (or expose a judge override inartemis.jsonc).
Workaround
Locally re-pointing the five call sites to the OpenAI factory and setting every node to provider: "openai" makes Flash tasks complete end-to-end with zero Google calls (verified on a physical Android device), so the rest of the pipeline is already provider-agnostic.
I have a fix along the lines above and will open a PR referencing this issue.
Environment
- ARTEMIS
main@371aa6d(2026-09-11) - Python 3.12, Windows 11,
uv syncinstall
Activity
Honor the configured LLM provider instead of hardcoding Google
coygeek commentedon Oct 25, 2026
A current-source constructor-only check adds an OpenRouter case, an agent-versus-utility control, and a startup bypass that needs no source patch.
Baseline: default-branch source
351ca8422f7b5b54e80a9c1ce03a222e02415b6b(project metadata1.0; no repository release or tag), Python3.12.15,langchain-google-genai 4.3.4,langchain-core 1.5.6,langchain-openai 1.5.2,pydantic 2.13.4. Dependencies were reused read-only after matching the fresh checkout's lockfile and manifest; source imports resolved to that checkout.For the narrow empty-model path, I set
defaultand all existingnodesandpresetsto OpenRouter, withnvidia/nemotron-3.5-super-vl:freefor both primary and fallback, then set:{"agent": {"flash": {"step_summarizer": {"enabled": true, "model": ""}}}}With only a synthetic constructor token for OpenRouter and no Google/Gemini/GCP credentials, I initialized the real
ArtemisContextwith an unenteredDeviceContext(device_id="synthetic-unentered-device"). No genuine key or device is needed for these constructor checks. Results:The empty-model branch in
artemis/agents/flash/summarizer.py:164-173callsget_llm(..., name="summarizer", is_utils=True)and catches the lookup failure by retrying through Google.summarizeris an agent field inartemis/config/llm.py:75-89, absent fromLLMConfigUtils. This distinguishes a failed configured-agent lookup from an unchanged Gemini auxiliary model requiring its own key. The branch is also the narrow scope of the currently unmerged PR #141.A second constructor case with the auxiliary model explicitly set to the same OpenRouter model ID also failed with the missing-Google-key error. The shipped nonempty Gemini auxiliary defaults are separate model choices, so these observations should not be read as proof that changing only the primary provider must rewrite those defaults.
Disabling the optional step summarizer is a verified construction-only bypass here. Socket connections and process launches were blocked and counted: zero attempts for each. The device context was never entered, no runner/model invocation occurred, and this does not verify generated summaries, Pro task execution, or long-history compression. Pro's visual path shares this constructor; history capsules have a separate model/fallback path and need a distinct execution check.
fix(llm): resolve the provider for call sites that carry a bare model id
fix(llm): resolve the provider for call sites that carry a bare model id
fix(llm): resolve the provider for call sites that carry a bare model id