Summary
After the AionUi / AionCore repo split, the old AionUi PR iOfficeAI/AionUi#2514 no longer applies cleanly, but the runtime bug is still relevant.
Some OpenAI-compatible providers use a versioned API root that is not /v1, for example:
- Zhipu:
https://open.bigmodel.cn/api/paas/v4
- Ark:
https://ark.cn-beijing.volces.com/api/v3
- Qianfan:
https://qianfan.baidubce.com/v2
When these providers are used through AionRS, the request can become:
/api/paas/v4/v1/chat/completions
Expected:
/api/paas/v4/chat/completions
Current code after the split
AionUi still owns the preset provider list, but AionRS runtime URL resolution now lives in AionCore.
Relevant current AionCore behavior:
resolve_aionrs_url_and_compat() handles:
is_full_url
- Gemini
/v1beta/openai
- official OpenAI
max_completion_tokens
- It does not yet set
compat.api_path = "/chat/completions" for known non-/v1 OpenAI-compatible roots.
crates/aionui-system/src/model_fetcher/url_fixer.rs already knows these roots for model fetching: /v2, /api/v3, /api/paas/v4.
Proposed fix
In AionCore, when the mapped provider is openai and the base URL path ends with one of the known non-/v1 API roots:
set:
compat.api_path = Some("/chat/completions".to_owned());
Keep existing behavior unchanged for:
- official OpenAI
/v1
- DeepSeek and other normal
/v1 OpenAI-compatible providers
- Gemini
is_full_url = true
Acceptance criteria
- Zhipu
/api/paas/v4 resolves to root chat completions path.
- Ark
/api/v3 resolves to root chat completions path.
- Qianfan
/v2 resolves to root chat completions path.
- Trailing slash variants are covered.
- Official OpenAI
/v1 does not get this override.
- Existing
is_full_url behavior from AionCore#307 remains unchanged.
Related:
Summary
After the AionUi / AionCore repo split, the old AionUi PR iOfficeAI/AionUi#2514 no longer applies cleanly, but the runtime bug is still relevant.
Some OpenAI-compatible providers use a versioned API root that is not
/v1, for example:https://open.bigmodel.cn/api/paas/v4https://ark.cn-beijing.volces.com/api/v3https://qianfan.baidubce.com/v2When these providers are used through AionRS, the request can become:
Expected:
Current code after the split
AionUi still owns the preset provider list, but AionRS runtime URL resolution now lives in AionCore.
Relevant current AionCore behavior:
resolve_aionrs_url_and_compat()handles:is_full_url/v1beta/openaimax_completion_tokenscompat.api_path = "/chat/completions"for known non-/v1OpenAI-compatible roots.crates/aionui-system/src/model_fetcher/url_fixer.rsalready knows these roots for model fetching:/v2,/api/v3,/api/paas/v4.Proposed fix
In AionCore, when the mapped provider is
openaiand the base URL path ends with one of the known non-/v1API roots:/api/paas/v4/api/v3/v2set:
Keep existing behavior unchanged for:
/v1/v1OpenAI-compatible providersis_full_url = trueAcceptance criteria
/api/paas/v4resolves to root chat completions path./api/v3resolves to root chat completions path./v2resolves to root chat completions path./v1does not get this override.is_full_urlbehavior from AionCore#307 remains unchanged.Related: