Skip to content

Commit ae66c61

Browse files
Copilotpelikhan
andcommitted
Add comprehensive tests for Ollama model tag handling
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
1 parent d687f2c commit ae66c61

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/core/src/ollama.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,16 @@ describe("areOllamaModelsEquivalent", () => {
103103
assert.strictEqual(areOllamaModelsEquivalent("hf.co/bartowski/llama3.2", "hf.co/bartowski/llama3.2:latest"), true)
104104
assert.strictEqual(areOllamaModelsEquivalent("hf.co/bartowski/llama3.2:gguf", "hf.co/bartowski/llama3.2:latest"), false)
105105
})
106+
107+
test("handles case sensitivity correctly", () => {
108+
// Model names should be case-sensitive as in Docker registries
109+
assert.strictEqual(areOllamaModelsEquivalent("Llama3.2", "llama3.2:latest"), false)
110+
assert.strictEqual(areOllamaModelsEquivalent("LLAMA3.2", "llama3.2"), false)
111+
})
112+
113+
test("handles registry-like names correctly", () => {
114+
// Models with registry:port format should not get :latest added
115+
assert.strictEqual(normalizeOllamaModelName("registry:5000/model"), "registry:5000/model")
116+
assert.strictEqual(areOllamaModelsEquivalent("registry:5000/model", "registry:5000/model:latest"), false)
117+
})
106118
})

0 commit comments

Comments
 (0)