Repository navigation
feat(openrouter): 업체 지정 provider_routing (4.107.0) - #181
Merged
Merged
Conversation
…107.0)
OpenRouter 는 같은 모델 이름을 여러 업체가 서빙하고(qwen3.8-27b 23곳, deepseek-v4.1-flash
약 40곳, 업체마다 fp4·fp8·bf16·가격·속도가 다르다) 지정이 없으면 요청마다 고른다.
런타임에는 그 지정을 실을 자리가 없었다.
- OpenRouterClient(provider_routing={...}) 를 주면 요청 본문 provider 객체로 그대로 싣는다
(extra_body.provider, 생각 설정 reasoning 과 나란히). 키는 거르지 않는다 — OpenRouter 가 검사.
- 객체가 아니면 경고 후 무시, 빈 객체는 지정 없음.
- 생각 설정 거절로 다시 보낼 때도 업체 지정은 유지한다(몰래 다른 업체로 넘기지 않는다).
- 지정한 요청의 404 는 오류 문구에 provider_routing 을 붙인다.
- 호스트는 resolve_credentials 로 넘긴다 — build_client(credentials=...) 가 생성자로 전달.
실측(11-03, dev 파드에서 도구 1개 붙인 요청): qwen3.8-27b 지정 없음 → AkashML,
only=[alibaba]·allow_fallbacks=false → Alibaba. deepseek-v4.1-flash-1017 도 Alibaba.
테스트 14개 추가, llm_client·host·contract 1317 통과.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
무엇을 바꾸나
OpenRouter 는 같은 모델 이름을 여러 업체가 서빙한다.
qwen/qwen3.8-27b는 23곳,deepseek/deepseek-v4.1-flash-1017은 약 40곳이고, 업체마다 정밀도(fp4·fp8·bf16)·가격·속도가 다르다. 지정이 없으면 OpenRouter 가 요청마다 고른다. 런타임에는 그 지정을 실을 자리가 없었다.OpenRouterClient(provider_routing={...})를 주면 요청 본문의provider객체로 그대로 싣는다(extra_body.provider). 생각 설정(reasoning)과 나란히 간다. 키는 거르지 않는다 — OpenRouter 가 검사한다.provider_routing=...를 붙인다.resolve_credentials("openrouter", ...)로{"provider_routing": {...}}를 돌려주면 된다.build_client(credentials=...)가 생성자로 넘긴다.확인
qwen/qwen3.8-27b지정 없음 → AkashMLqwen/qwen3.8-27b{"only": ["alibaba"], "allow_fallbacks": false, "require_parameters": true}→ Alibaba, 도구 호출 정상deepseek/deepseek-v4.1-flash-1017같은 지정 → Alibaba, 도구 호출 정상tests/llm_client·host·contract 1317 passed.ruff format --check·ruff check·gen_event_docs.py --check통과.소비자
xgen-workflow 가 카탈로그 행의
capabilities.provider_routing을 읽어 넘긴다(별도 MR).🤖 Generated with Claude Code