Model router#5324
Conversation
…e builder with DnD, and system LLM support
angelplusultra
left a comment
There was a problem hiding this comment.
Nice work, everything seems to work smoothly.
I dont see this env var updated in the .env.example. It should be grouped
# LLM_PROVIDER="anythingllm-router"
# MODEL_ROUTER_ID=1
|
@angelplusultra just a couple new changes here:
|
angelplusultra
left a comment
There was a problem hiding this comment.
Just a few minor nits and one UI suggestion:
I’m not sure having an AND/OR button for every individual condition is the best fit here. Since all conditions are evaluated together using a single logical operator, it feels a bit redundant in this flat structure. I think this pattern would make more sense if we were supporting nested/grouped conditions, but that doesn’t seem to be the case right now. As it stands, this feels like a step back from the previous implementation.
Also, I noticed that the alignment starts to shift when selecting values that include caption text, which makes the layout feel a bit uneven.
Some possible ideas to explore:
- Moving the caption/help text into a tooltip so the row layout stays consistent
- Aligning the AND/OR control more closely with the input row to prevent visual drift
| const isActive = hasChildren | ||
| ? (!isExpanded && | ||
| childOptions.some((child) => child.href === location.pathname)) || | ||
| childOptions.some((child) => | ||
| isPathMatch(child.href, location.pathname) | ||
| )) || | ||
| location.pathname === href | ||
| : location.pathname === href; | ||
| : isPathMatch(href, location.pathname); | ||
|
|
There was a problem hiding this comment.
What was the reasoning for the modification of this change? Did this sub-menu option highlight system not work prior?
| if (routers.length === 0) { | ||
| return ( | ||
| <p className="text-xs text-zinc-400 light:text-slate-500"> | ||
| {t("model-router.router-selection.no-routers-chat")} | ||
| </p> | ||
| ); | ||
| } |
There was a problem hiding this comment.
Have this link to the settings page in the prompt model dropdown like we do in the workspace chat selection UI as well


Pull Request Type
Relevant Issues
resolves #5313
Translations PR: #5390
Docs PR: Mintplex-Labs/anythingllm-docs#245
Description
Visuals (if applicable)
Model routing animation
model.routing.animation.mov
Chat UI with model router switching to different models
Agent mode chat UI with router switching to different models
Model router settings page
Editing router
Router rules configuration
Additional Information
Developer Validations
yarn lintfrom the root of the repo & committed changes