mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-13 00:14:15 +00:00
feat: support ollama cloud anthropic compatible api (#1175)
* feat(droid-provider): support ollama cloud anthropic compatible api * fix(droid-provider): move ollama.com to anthropic block to prevent model inference override * fix(droid-provider): move pathname-based generic checks before host-based anthropic check * test(proxy): cover ollama cloud native routing boundaries --------- Co-authored-by: Tam Nhu Tran <kaitran.ntt@gmail.com>
This commit is contained in:
1 parent
0070f79b90
commit
4e2def6769
3 files changed
+69
-6
No files matched your search
@@ -76,7 +76,19 @@ export function inferDroidProviderFromBaseUrl(
|
||||
return 'openai';
|
||||
}
|
||||
|
||||
if (host.includes('anthropic.com') || pathname.includes('/anthropic')) {
|
||||
if (
|
||||
pathname.includes('/compatible-mode') ||
|
||||
pathname.includes('/openai') ||
|
||||
pathname.includes('/chat/completions')
|
||||
) {
|
||||
return 'generic-chat-completion-api';
|
||||
}
|
||||
|
||||
if (
|
||||
host.includes('anthropic.com') ||
|
||||
pathname.includes('/anthropic') ||
|
||||
host.includes('ollama.com')
|
||||
) {
|
||||
return 'anthropic';
|
||||
}
|
||||
|
||||
@@ -87,11 +99,7 @@ export function inferDroidProviderFromBaseUrl(
|
||||
host.includes('api.fireworks.ai') ||
|
||||
host.includes('inference.baseten.co') ||
|
||||
host.includes('dashscope') ||
|
||||
host.includes('huggingface.co') ||
|
||||
host.includes('ollama.com') ||
|
||||
pathname.includes('/compatible-mode') ||
|
||||
pathname.includes('/openai') ||
|
||||
pathname.includes('/chat/completions')
|
||||
host.includes('huggingface.co')
|
||||
) {
|
||||
return 'generic-chat-completion-api';
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user