mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-16 12:14:55 +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
@@ -94,5 +94,31 @@ describe('droid-provider', () => {
|
||||
expect(resolveDroidProvider({ baseUrl: 'http://127.0.0.1:8317' })).toBe('anthropic');
|
||||
expect(resolveDroidProvider({})).toBe('anthropic');
|
||||
});
|
||||
|
||||
it('defaults ollama.com to anthropic', () => {
|
||||
expect(resolveDroidProvider({ baseUrl: 'https://ollama.com' })).toBe('anthropic');
|
||||
expect(resolveDroidProvider({ baseUrl: 'https://ollama.com/v1/messages' })).toBe('anthropic');
|
||||
});
|
||||
|
||||
it('keeps ollama.com anthropic even for generic model families', () => {
|
||||
expect(
|
||||
resolveDroidProvider({
|
||||
baseUrl: 'https://ollama.com',
|
||||
model: 'qwen3-coder-plus',
|
||||
})
|
||||
).toBe('anthropic');
|
||||
expect(
|
||||
resolveDroidProvider({
|
||||
baseUrl: 'https://ollama.com/v1/messages',
|
||||
model: 'deepseek-v3.1',
|
||||
})
|
||||
).toBe('anthropic');
|
||||
});
|
||||
|
||||
it('routes ollama.com /chat/completions to generic', () => {
|
||||
expect(resolveDroidProvider({ baseUrl: 'https://ollama.com/v1/chat/completions' })).toBe(
|
||||
'generic-chat-completion-api'
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user