microsoft-foundry / microsoft-foundry/Model-Router-Auto-Evaluation
[Bug]: Support Foundry OpenAI v1 and Responses API endpoints in live evaluations
Nessuno ha ancora preso questa issue.
- Lingua principale
- HTML
- Stelle
- 29
- Fork
- 11
- Merge medio
- 2h 48m
- PR unite (30g)
- 2
Descrizione
Pre-flight checklist
- I have searched existing issues and this is not a duplicate.
- I have read the FAQ.
- I have removed any API keys, endpoints, or other secrets from logs and config snippets I paste below.
Summary
Live evaluations returned 404 Resource not found for every Model Router and baseline request, despite valid keys and deployments.
The repository configured all endpoints using AsyncAzureOpenAI and hard-coded chat.completions.create(). However, current Foundry endpoints use the OpenAI v1 format: https://<resource>.services.ai.azure.com/openai/v1
Model Router uses /chat/completions, while some baseline and judge deployments use /responses. Supplying the full portal Target URI did not work because the SDK appended another operation path. Removing part of the resource hostname caused APIConnectionError because the resulting hostname did not exist.
A secondary error occurred after all requests failed: AttributeError: 'NoneType' object has no attribute 'get'
The verifier assumed cost and latency metrics were dictionaries, but all-error runs serialize them as null.
I used GitHub Copilot to resolve the issue and I'm sharing it's summarized proposed fix below:
- Add an endpoint
api_modesetting supporting:chat_completionsandresponses - Use
AsyncOpenAIwith the Foundry/openai/v1base URL. - Map request and token fields appropriately for each API.
- Configure Model Router for Chat Completions and baseline/judge models for Responses.
- Reject URLs ending in
/chat/completionsor/responseswith an actionable configuration error. - Update
.env.example, presets, documentation, and SDK dependency requirements. - Treat
nullcost and latency metrics as missing data instead of crashing verification.
When validating this fix, all three configured live deployments succeeded with minimal smoke requests. The non-live suite passed with 181 tests, along with lint, dependency checks, and configuration dry-run validation.
Steps to reproduce
- Update
.envbaseline model togpt-5.6-soland the judge model togpt-5.5 - Set pricing region to
westus3 - In
live_demo.yamlreplacedatasetwith a custom dataset. - Run
.\scripts\demo.ps1 -Live
Expected behaviour
Evaluation should happen, including the generated report.
Actual behaviour
Model Router errors: 10/10 [nwt_001] NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}} [nwt_002] NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}} [nwt_003] NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}} [nwt_004] NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}} [nwt_006] NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}} [nwt_005] NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}} [nwt_007] NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}} [nwt_008] NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}} [nwt_010] NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}} [nwt_009] NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}} Baseline errors: 10/10 [nwt_001] NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}} [nwt_002] NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}} [nwt_003] NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}} [nwt_004] NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}} [nwt_006] NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}} [nwt_005] NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}} [nwt_007] NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}} [nwt_008] NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}} [nwt_010] NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}} [nwt_009] NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}} Traceback (most recent call last): File "C:\Users\apspeigh\Documents\Model-Router-Auto-Evaluation\scripts\run_eval.py", line 167, in <module> main()
File "C:\Users\apspeigh\Documents\Model-Router-Auto-Evaluation\scripts\run_eval.py", line 160, in main
vr = verify_local_eval(config.output_directory)
File "C:\Users\apspeigh\Documents\Model-Router-Auto-Evaluation\src\verify.py", line 102, in verify_local_eval
if cost.get("estimated_cost_usd") is not None:
^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'
Exception: C:\Users\apspeigh\Documents\Model-Router-Auto-Evaluation\scripts\demo.ps1:65:13
Line |
65 | throw "Live evaluation failed."
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Live evaluation failed.
### Which part of the pipeline is affected?
Other / not sure
### Python version
3.13.15
### Operating system
Windows 11
### Repo commit or release
_No response_
### Relevant configuration
```yaml
```
### Logs and screenshots
```shell
```
### Additional context
I have the updated files w/ the GitHub Copilot fix if you'd like it.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia da scripts/run_eval.py e src/verify.py, quindi segui la configurazione degli endpoint attraverso live_demo.yaml, .env.example, i preset e la documentazione. Verifica come il client di valutazione seleziona tra Chat Completions e Responses e come la verifica gestisce le metriche di costo e latenza con valore null. Il lavoro è completato quando i deployment live terminano e generano un report, mentre la suite esistente di 181 test, il lint, i controlli delle dipendenze e la validazione della configurazione continuano a superare i controlli.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- azure, python
- Ambito
- ai, api, testing
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Attiva
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 52/100