lex-llm-ollama 0.2.9 → 0.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/legion/extensions/llm/ollama/provider.rb +23 -3
- data/lib/legion/extensions/llm/ollama/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 367e593d0f98eed36e553e82356f0c86e37dd8e4a1324674c388f0383e59034d
|
|
4
|
+
data.tar.gz: f9d24ec554a9be7be90d33c76ddbb7d475a976c8158ceda71f596fcc8bfa42dd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5be0235ede9a88b3b355cd2d6232c885332f6bcf8f5e0041922d496a76b5335c1533edd193b50c8ffe1f04953305b6527d7c60ac1a46b8d35d9cf28535902c36
|
|
7
|
+
data.tar.gz: cce2dd847b6fa13f1c8bf2c2a84df522315ed1d8af2f0e524e0564309a24494b4336432a57c60e3b2570402354923f1de805c7d721131d30939e633624f8aa4e
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.10 - 2026-05-16
|
|
4
|
+
|
|
5
|
+
- Stop assuming every non-embedding Ollama model supports tools; fallback chat discovery now advertises completion, streaming, and vision only.
|
|
6
|
+
- Add canonical Ollama capability normalization so reported `tools`/function-calling metadata is preserved and streaming is inferred for chat/completion models.
|
|
7
|
+
- Include reported capability metadata from `/api/show` model detail responses.
|
|
8
|
+
|
|
3
9
|
## 0.2.9 - 2026-05-13
|
|
4
10
|
|
|
5
11
|
- Add `fetch_model_detail` — calls POST `/api/show` to retrieve the real context window from Ollama.
|
|
@@ -90,7 +90,7 @@ module Legion
|
|
|
90
90
|
def fetch_model_detail(model_name)
|
|
91
91
|
raw = show_model(model_name)
|
|
92
92
|
context_window = extract_context_window(raw)
|
|
93
|
-
{ context_window: context_window }.compact
|
|
93
|
+
{ context_window: context_window, capabilities: extract_capabilities(raw) }.compact
|
|
94
94
|
rescue StandardError => e
|
|
95
95
|
handle_exception(e, level: :warn, handled: true, operation: 'ollama.fetch_model_detail',
|
|
96
96
|
model: model_name)
|
|
@@ -372,15 +372,35 @@ module Legion
|
|
|
372
372
|
end
|
|
373
373
|
|
|
374
374
|
def infer_capabilities(name, family, api_caps)
|
|
375
|
-
|
|
375
|
+
normalized = normalize_ollama_capabilities(api_caps)
|
|
376
|
+
return normalized unless normalized.empty?
|
|
376
377
|
|
|
377
378
|
if embedding_model?(name, family)
|
|
378
379
|
[:embedding]
|
|
379
380
|
else
|
|
380
|
-
%i[completion streaming
|
|
381
|
+
%i[completion streaming vision]
|
|
381
382
|
end
|
|
382
383
|
end
|
|
383
384
|
|
|
385
|
+
def normalize_ollama_capabilities(capabilities)
|
|
386
|
+
Array(capabilities).compact.each_with_object([]) do |capability, result|
|
|
387
|
+
capability_sym = capability.to_s.downcase.strip.to_sym
|
|
388
|
+
next if capability_sym.to_s.empty?
|
|
389
|
+
|
|
390
|
+
result << capability_sym
|
|
391
|
+
result << :tools if %i[function_calling functions tool tool_use].include?(capability_sym)
|
|
392
|
+
result << :streaming if %i[chat completion].include?(capability_sym)
|
|
393
|
+
end.uniq
|
|
394
|
+
end
|
|
395
|
+
|
|
396
|
+
def extract_capabilities(raw)
|
|
397
|
+
return nil unless raw.is_a?(Hash)
|
|
398
|
+
|
|
399
|
+
caps = raw['capabilities'] || raw[:capabilities]
|
|
400
|
+
normalized = normalize_ollama_capabilities(caps)
|
|
401
|
+
normalized unless normalized.empty?
|
|
402
|
+
end
|
|
403
|
+
|
|
384
404
|
def embedding_model?(name, family)
|
|
385
405
|
name.to_s.match?(/embed|embedding/i) || family.to_s.match?(/bert|nomic/i)
|
|
386
406
|
end
|