gpt_auto_router

Gemini Flash policy router for per-user Codex quota turns.

The router chooses only among options already authorized by the user’s !gpt policy and advertised by the linked Codex account. It never writes a reply, invokes tools, or becomes a fallback inference provider.

class gpt_auto_router.AutoRouteChoice(model_alias, effort, used_fallback=False)

Bases: object

One validated model/effort choice from the allowed candidate set.

Parameters:
  • model_alias (str)

  • effort (str)

  • used_fallback (bool)

model_alias: str
effort: str
used_fallback: bool
async gpt_auto_router.choose_gpt_auto_route(http_client, *, base_url, api_key, user_text, context_metadata=None, model_candidates, effort_candidates, pair_candidates=None, model='gemini-3.1-flash-lite', timeout_seconds=3.0)

Choose one allowed Codex model/effort pair with Gemini Flash.

Invalid, unavailable, or slow middleware falls back deterministically to the first allowed pair. That fallback remains a Codex route; Gemini never produces the user’s answer.

Return type:

AutoRouteChoice

Parameters: