mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-14 04:15:52 +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
@@ -50,4 +50,33 @@ describe('resolveOpenAICompatProfileConfig', () => {
|
||||
expect(result?.provider).toBe('generic-chat-completion-api');
|
||||
expect(result?.model).toBe('qwen3.6-plus');
|
||||
});
|
||||
|
||||
it('does not proxy bare ollama.com profiles that are anthropic-native', () => {
|
||||
const result = resolveOpenAICompatProfileConfig(
|
||||
'ollama-cloud',
|
||||
'/tmp/ollama-cloud.settings.json',
|
||||
{
|
||||
ANTHROPIC_BASE_URL: 'https://ollama.com',
|
||||
ANTHROPIC_AUTH_TOKEN: 'ollama-token',
|
||||
ANTHROPIC_MODEL: 'qwen3-coder-plus',
|
||||
}
|
||||
);
|
||||
|
||||
expect(result).toBeNull();
|
||||
});
|
||||
|
||||
it('still proxies explicit ollama.com chat-completions endpoints', () => {
|
||||
const result = resolveOpenAICompatProfileConfig(
|
||||
'ollama-cloud-chat-completions',
|
||||
'/tmp/ollama-cloud-chat-completions.settings.json',
|
||||
{
|
||||
ANTHROPIC_BASE_URL: 'https://ollama.com/v1/chat/completions',
|
||||
ANTHROPIC_AUTH_TOKEN: 'ollama-token',
|
||||
ANTHROPIC_MODEL: 'qwen3-coder-plus',
|
||||
}
|
||||
);
|
||||
|
||||
expect(result).not.toBeNull();
|
||||
expect(result?.provider).toBe('generic-chat-completion-api');
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user