Skip to content

Remove modelRouter and add model_providers concept#224

Merged
philipph-askui merged 61 commits intomainfrom
chore/modelrouter
Feb 24, 2026
Merged

Remove modelRouter and add model_providers concept#224
philipph-askui merged 61 commits intomainfrom
chore/modelrouter

Conversation

@philipph-askui
Copy link
Contributor

@philipph-askui philipph-askui commented Jan 21, 2026

[Edited] PR Description

To get a quick idea of the new API, I added an example under examples/model_providers.py that you can run
Note: You will need an anthropic API Key for that

This PR:

  • Removes ModelRouter, ModelRegistry, and model_store
  • Introduces a provider-based configuration system (AgentSettings)
  • Renames VisionAgent → ComputerAgent and AndroidVisionAgent → AndroidAgent
  • Updates docs and examples

Summary

  • Replaced the ModelRouter/model_store abstraction with three typed provider slots (vlm_provider, image_qa_provider, detection_provider) configured via AgentSettings
  • Providers own their endpoint, credentials, and model ID — validated lazily on first API call
  • get() and locate() are now backed by GetTool/LocateTool, which are also available to the LLM during act() — no separate model injection path
  • Significantly reduced codebase complexity (~4600 lines removed)
  • Updated all docs and examples to reflect the new API

Key Changes

  • AgentSettings: single configuration object with provider slots; defaults to AskUI-hosted providers reading credentials from env vars
  • Built-in providers: AskUIVlmProvider, AskUIImageQAProvider, AskUIDetectionProvider, AnthropicVlmProvider, AnthropicImageQAProvider, GoogleImageQAProvider, OpenAICompatibleProvider
  • GetTool / LocateTool: wired into the act loop as ToolWithAgentOS — LLM can call them directly during act()
  • Deleted: entire src/askui/model_store/ directory
  • Renamed: VisionAgent → ComputerAgent, AndroidVisionAgent → AndroidAgent
  • Docs: 03_Using-Models-and-BYOM.md fully rewritten; VisionAgent replaced with ComputerAgent across all docs

Further Changes

  • removes chat-api related code as it was deprecated

  • removes UI-TARS related code as it was deprecated

    Breaking Changes

    • VisionAgent is removed — use ComputerAgent
    • AndroidVisionAgent is removed — use AndroidAgent
    • act_model, get_model, locate_model constructor parameters are removed — use AgentSettings(vlm_provider=..., image_qa_provider=..., detection_provider=...)
    • model_store factory functions are removed
    • String-based model selection is removed

…del store

BREAKING CHANGE: Removed ModelRouter and ModelRegistry classes. Users must now use direct model injection.
@philipph-askui philipph-askui changed the title Chore/modelrouter Remove Modelrouter Jan 21, 2026
@philipph-askui philipph-askui changed the title Remove Modelrouter Remove modelRouter and add mode_store Jan 22, 2026
@philipph-askui philipph-askui marked this pull request as ready for review January 26, 2026 06:53
@philipph-askui
Copy link
Contributor Author

I added a new optional dependency group "tracing", that contains all the OTEL packages.

from askui.models.shared.tools import ToolCollection


def _to_openai_messages(messages: list[MessageParam]) -> list[dict[str, Any]]: # noqa: C901
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I review this?

I would expect here an integration tests. Which coveres all message types.

@@ -0,0 +1,886 @@
# Using Models and BYOM (Bring Your Own Model)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SnakeCase

Rename to "Bring Your Own Model Provider"

docs/05_Tools.md Outdated
| Adaptive to UI changes | ❌ | ✅ |
| Require no AI inference | ✅ | ❌ |

**Example combining both approaches:**
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed in 389b649

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i suggest to wait with deprecating the pylon page until this is merged. Or do you want to deprecate it right now?

Copy link
Collaborator

@programminx-askui programminx-askui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the new document structure. much more clearer

@philipph-askui philipph-askui merged commit 61e42df into main Feb 24, 2026
1 check passed
@philipph-askui philipph-askui deleted the chore/modelrouter branch February 24, 2026 08:43
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.

4 participants