This page is machine-translated from French. Read the French original.

Model router

A router It automatically selects, message by message, which model should respond. It allows for everyday use with an economical model, while reserving a more powerful model for cases that warrant it.


What is it for?

  • Controlling the cost — a small model deals with simple questions, a large model with complex analyses.
  • Preserve confidentiality — exchanges relating to sensitive subjects remain on a local model; the rest can go to an external supplier.
  • Managing capacities — Messages containing an image go to a model that knows how to process them.
  • Adapt to the moment — a different model outside of working hours.

Functioning

A router consists of:

  • a fallback destination — the model used when no rule applies; ;
  • a list of rules, evaluated with each message; ;
  • a adhesion duration — the period during which a conversation remains on the chosen pattern.

When a rule matches, its model takes precedence. Otherwise, the fallback applies.

Adhesion

Without it, a conversation would bounce from one model to another depending on the messages, with breaks in style and coherence.

Once a rule has directed a conversation to a pattern, the conversation there stay for the configured duration, even if subsequent messages no longer match any rules. This is what makes routing usable in a real-world discussion.


The two types of rules

Calculated rules

They rely on measurable criteria, evaluated without recourse to the model — therefore instantly and free of charge.

Criteria Examples of use
Message content Contains a given term, or corresponds to a pattern
Conversation size Beyond a certain volume, switch to a model with a large context window.
Number of messages After several exchanges, change the model
Current time A different model at night or on weekends
Presence of an image Moving towards a multimodal model

Available comparators: contains, corresponds to, greater than, greater than or equal to, less than, less than or equal to, equal to, different from, between. Several conditions can be combined.

Rules by classification

You describe in natural language the type of message concerned, and a lightweight model classifies each message.

Example description: «"The message requires in-depth legal analysis, comparison of several contracts, or the drafting of a formal document."»

More flexible than a calculated rule, but each classification has a cost. The result is therefore cached for the duration of the adherence, which avoids reclassifying each message in the same conversation.


Configure — administrator

Réglages → Routeurs de modèles.

  1. Create a router : name, description, fallback destination, duration of adhesion.
  2. Add rules, each with its own type, conditions and destination.
  3. Assign the router to a workspace — this then no longer uses a fixed model, but the router.

A router can also be designated as the instance's default router.


Configuration examples

Save money without harming the environment

  • Retreat: fast local model.
  • Rule by classification: «"Complex analysis, multi-step reasoning, or lengthy writing" → powerful model.
  • Calculated rule: Conversation exceeding a significant volume → large context window model.

Protecting the sensitive

  • Retreat: high-performing external supplier.
  • Calculated rule: the message contains terms marking confidentiality → local template.
  • Rule by classification: «"The message concerns personally identifiable personal, medical or financial data" → local model.

Manage images

  • Retreat: text model.
  • Calculated rule: presence of an image attachment → multimodal model.

Points to consider

A poorly written rule goes unnoticed. A router that never directs anything behaves like a unique model, without indicating this. Test each rule after creation.

Order matters. The rules are evaluated in order; the first one that matches wins. Place the most specific ones first.

Classification costs money. Each classification represents an additional call. On a router with only classification rules, the economic gain can be offset by the cost of classification.

Adhesion is a compromise. If it's too short, the conversation switches to a different format mid-conversation; if it's too long, a message that deserves the larger format remains in the smaller one. A few dozen seconds is sufficient in most cases.

Notify the users. Inconsistent response quality from one message to another is confusing if one is unaware that a router is in place.