Skip to content

feat(llm-routing): accept and persist routing expressions in the function API #1407

Description

@along-2017

Description

Part of #536 (per-model routing configuration).

Let function owners persist routing expressions in llmConfig.routingMethod.
The function management API validates syntax only, against the same RFC 8941
profile the router parses: a well-formed expression persists even when its
method, parameter, type, or range is semantically wrong. The router is the
semantic authority and rejects such values at request time.

The value is stored as received apart from leading and trailing spaces: no
lowercasing, underscore folding, or alias mapping. The router already folds
case and underscores and resolves alias spellings when it resolves the
algorithm name, so every spelling accepted today keeps working. Tabs, line
breaks, and other control characters anywhere in the value are rejected.
Expressions keep the existing per-function scope: an update on any version
propagates to all versions.

There is no feature flag and no deploy ordering. In an environment whose
routers do not parse expressions yet, a model configured with parameters is
rejected by the router at request time until the routers upgrade or the owner
reverts to a method-only value.

Definition of Done

  • Well-formed expressions persist via create, version create, and update
    in JSON model definitions; malformed expressions are rejected with a
    message naming the model and the violated rule
  • Semantically wrong but well-formed expressions persist by design
  • The persisted value equals the submitted value apart from leading and
    trailing spaces
  • Updates propagate across the function's versions as today
  • Table-driven tests cover the grammar profile, the stored form, and both
    API paths

Resources

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions