Add AWF /reflect reference for gateway-based model discovery and routing#31540
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
Add AWF /reflect route documentation page
Add AWF May 11, 2026
/reflect reference for gateway-based model discovery and routing
Copilot created this pull request from a session on behalf of
pelikhan
May 11, 2026 16:30
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new documentation reference page for AWF GET /reflect, intended to guide shared workflows/tools in discovering gateway inference endpoints, understanding model availability, and routing requests through the gateway.
Changes:
- Adds a new reference doc page:
docs/src/content/docs/reference/awf-reflect.md. - Documents recommended runtime selection flow and retry guidance for transient model discovery states.
- Adds a new sidebar entry under Reference in
docs/astro.config.mjs.
Show a summary per file
| File | Description |
|---|---|
| docs/src/content/docs/reference/awf-reflect.md | New /reflect reference page describing endpoint/model discovery and dynamic routing guidance. |
| docs/astro.config.mjs | Adds the new AWF Reflect Route page to the Reference sidebar navigation. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
docs/src/content/docs/reference/awf-reflect.md:43
- Step 6 suggests retrying discovery whenever
modelsisnull, but in practicemodelscan benullfor reasons that won’t change with retries (e.g.,models_urlisnull, or model listing isn’t supported), and the more reliable signal for “still warming up” ismodels_fetch_completeplus whethermodels_urlis present for a configured endpoint. Suggest adjusting the guidance to (a) only retry/reflectwhilemodels_fetch_completeis false, and/or (b) ifconfiguredis true andmodels_urlis present, querymodels_urldirectly to populate models; otherwise treatmodelsas unavailable.
1. Query `/reflect` at start of execution.
2. Filter endpoints to `configured: true`.
3. Prefer endpoints with a non-empty `models` list.
4. Match requested model aliases/patterns against available models.
5. Route inference to the selected endpoint `base_url`.
6. If `models` is `null`, retry discovery with bounded backoff (for example, every 3 seconds up to 5 attempts) before failing.
- Files reviewed: 2/2 changed files
- Comments generated: 1
Comment on lines
+30
to
+42
| - `endpoints[].configured`: whether credentials/config are present for that provider | ||
| - `endpoints[].models`: discovered model IDs, or `null` when model discovery is not yet complete | ||
| - `endpoints[].models_url`: gateway URL used to query models for that provider | ||
| - `models_fetch_complete`: whether startup model discovery is complete | ||
|
|
||
| ## Recommended selection flow for shared tools | ||
|
|
||
| 1. Query `/reflect` at start of execution. | ||
| 2. Filter endpoints to `configured: true`. | ||
| 3. Prefer endpoints with a non-empty `models` list. | ||
| 4. Match requested model aliases/patterns against available models. | ||
| 5. Route inference to the selected endpoint `base_url`. | ||
| 6. If `models` is `null`, retry discovery with bounded backoff (for example, every 3 seconds up to 5 attempts) before failing. |
This was referenced May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New Feature
This PR adds a dedicated reference page for AWF
GET /reflect, documenting how shared workflows/tools discover gateway inference endpoints, determine model availability, and choose models dynamically at runtime. It also codifies the requirement to route inference through the gateway rather than direct provider endpoints to preserve cost controls, tracking, and optimization signals.What does this feature do?
docs/src/content/docs/reference/awf-reflect.mdas the canonical/reflectdocumentation.provider,base_url,configured,models,models_url,models_fetch_complete)./reflect→ filter configured endpoints → prefer populated model lists → select provider/model dynamically.Why is this feature needed?
Implementation details
docs/astro.config.mjsunder Reference (/reference/awf-reflect/).models: nullstates during model discovery.