Skip to content

fix(llm): resolve the provider for call sites that carry a bare model id - #238

Open
HaticeSarp wants to merge 1 commit into
google:mainfrom
HaticeSarp:fix/provider-routing
Open

HaticeSarp wants to merge 1 commit into
google:mainfrom
HaticeSarp:fix/provider-routing

Conversation

@HaticeSarp

Copy link
Copy Markdown

Several paths instantiate Google's client directly via get_google_llm() instead of going through the configured provider, so configuring a non-Google provider for every node in artemis.jsonc is still not enough to run a Flash task. On an OpenRouter-only setup each of these raises "API key required for Gemini Developer API"; the run keeps going and history compression dies silently for the whole session.

  • services/llm.py: add get_llm_for_model_id(), which infers the provider from the shape of the model id for the config paths that carry a model name with no provider beside it. Namespaced ids ("vendor/model", with an optional ":suffix" routing tag) go to OpenRouter; bare ids keep the historical Google default.
  • agents/flash/summarizer.py, memory/chunking.py: use it for the lens and fallback models instead of pinning Google.
  • agents/flash/runner.py: the emergency operator fallback hardcoded gemini-2.5-flash, which is unusable off Google and turned a recoverable config error into a hard failure. Read the configured operator model and only fall back to the hardcoded id if the config cannot be read at all.
  • config/llm.py: the lightweight judge nodes (pixel safety net, planner validation) are not reachable through the "default"/"nodes" shorthand, so they pinned a Google flash-lite id regardless of the run's provider. They now keep that flash-lite default whenever it is actually reachable - the run is on Google - and otherwise follow the run's resolved config. Only temperature is forced to 0.

Google setups keep exactly the models they have today; the change is scoped to the case where the pinned model is unreachable.

Adds tests/unit/test_llm_provider_inference.py covering provider inference and both judge-default branches.

make test shows no new failures against origin/main (80 pre-existing failures before and after); make lint and make typecheck are clean.

Fixes #95
Refs #167

@google-cla

google-cla Bot commented Nov 9, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@HaticeSarp

Copy link
Copy Markdown
Author

@googlebot I signed it!

@HaticeSarp HaticeSarp closed this Nov 9, 2026
@HaticeSarp HaticeSarp reopened this Nov 9, 2026
Several paths instantiate Google's client directly via get_google_llm()
instead of going through the configured provider, so configuring a
non-Google provider for every node in artemis.jsonc is still not enough to
run a Flash task. On an OpenRouter-only setup each of these raises "API key
required for Gemini Developer API"; the run keeps going and history
compression dies silently for the whole session.

- services/llm.py: add get_llm_for_model_id(), which infers the provider
  from the shape of the model id for the config paths that carry a model
  name with no provider beside it. Namespaced ids ("vendor/model", with an
  optional ":suffix" routing tag) go to OpenRouter; bare ids keep the
  historical Google default.
- agents/flash/summarizer.py, memory/chunking.py: use it for the lens and
  fallback models instead of pinning Google.
- agents/flash/runner.py: the emergency operator fallback hardcoded
  gemini-2.5-flash, which is unusable off Google and turned a recoverable
  config error into a hard failure. Read the configured operator model and
  only fall back to the hardcoded id if the config cannot be read at all.
- config/llm.py: the lightweight judge nodes (pixel safety net, planner
  validation) are not reachable through the "default"/"nodes" shorthand, so
  they pinned a Google flash-lite id regardless of the run's provider. They
  now keep that flash-lite default whenever it is actually reachable - the
  run is on Google - and otherwise follow the run's resolved config. Only
  temperature is forced to 0.

Google setups keep exactly the models they have today; the change is scoped
to the case where the pinned model is unreachable.

Adds tests/unit/test_llm_provider_inference.py covering provider inference
and both judge-default branches.

make test shows no new failures against origin/main (80 pre-existing
failures before and after); make lint and make typecheck are clean.

Fixes google#95
Refs google#167
@HaticeSarp
HaticeSarp force-pushed the fix/provider-routing branch from d18acfa to 7729d52 Compare November 9, 2026 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Step summarizer, memory chunking and Flash operator fallback hardcode the Google provider, bypassing artemis.jsonc

1 participant