Skip to content

feat(router): publish model capabilities on /v1/models and /v1/models/{id} - #30

Merged
eksrha merged 1 commit into
mainfrom
feat/capabilities
Nov 14, 2026
Merged

eksrha merged 1 commit into
mainfrom
feat/capabilities

Conversation

@eksrha

@eksrha eksrha commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

What

Every model entry on GET /v1/models gets an additive capabilities object, and GET /v1/models/{id} is added (OpenAI shape, 404 object for unknown ids).

{"tasks":["transcribe"],"audio":{"prompt":false,"hotwords":false,"word_times":true,"segment_times":true,"confidence":true,"auto_language":true,"force_language":false,"max_seconds":120,"max_bytes":26214400}}

Why

The two transcription backends differ: one takes a prompt and hotwords, the other accepts and ignores them; limits on audio length and upload size differ as well. A client had to guess from the model name. With the field it can send hints only where they help, ask for word timestamps only where they exist, and cut audio to the accepted length.

How

  • Values come from router configuration, never from what a backend reports about itself (an upstream capabilities field is dropped; tested).
  • Defaults match the bundled servers. Override per backend with <NAME>_CAPABILITIES (JSON) or router.capabilities.<backend> in the chart. A malformed value stops the router at start.
  • Existing fields and behaviour are unchanged; the new field is omitted when a backend has none configured.

Tests

Config defaults, override and malformed input; models list carries capabilities (upstream OK and static fallback); /v1/models/{id} incl. ids with a slash and the 404; no field without configuration. go test -race ./... and helm template with and without router.capabilities.

…/{id}

Clients can see per model whether a prompt or hotwords have any effect, whether
word timestamps and confidence are returned, and the longest audio and largest
upload accepted, instead of guessing from the model name. The values come from
the router configuration (defaults match the bundled servers, override with
<NAME>_CAPABILITIES or router.capabilities in the chart); what a backend claims
about itself is never passed through. The field is additive.
@github-actions

Copy link
Copy Markdown
Possible relctl commands for this Pull Request

Version scheme: calver. The version of the release is the date of the release (YYYYMM.D.N, N counts the releases of that day). Branch prefixes and comment commands have no effect.

Need more help?

Have a look at my repo

This message was created by relctl and can be disabled by the env variable RELCTL_SILENT=true

@eksrha
eksrha merged commit 6c0bb11 into main Nov 14, 2026
5 checks passed
@eksrha
eksrha deleted the feat/capabilities branch November 14, 2026 13:39
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.

1 participant