Module: Legion::Extensions::Llm::Vllm::Provider::Capabilities
- Defined in:
- lib/legion/extensions/llm/vllm/provider.rb
Overview
Capability predicates for vLLM OpenAI-compatible model
offerings. V7: per-model derivation — the same model-type split
the discovery runner publishes: an embedding model does not serve
chat or streaming, a chat model does not serve embeds. The static
every-model-streaming claims are deleted.
Class Method Summary collapse
- .chat?(model) ⇒ Boolean
- .critical_capabilities_for(model) ⇒ Object
-
.embedding_model?(model) ⇒ Boolean
The one model-type predicate, shared with the discovery runner's build_offering_draft.
- .embeddings?(model) ⇒ Boolean
- .functions?(_model) ⇒ Boolean
- .streaming?(model) ⇒ Boolean
- .vision?(_model) ⇒ Boolean
Class Method Details
.chat?(model) ⇒ Boolean
222 |
# File 'lib/legion/extensions/llm/vllm/provider.rb', line 222 def chat?(model) = !(model) |
.critical_capabilities_for(model) ⇒ Object
228 229 230 231 232 233 234 235 |
# File 'lib/legion/extensions/llm/vllm/provider.rb', line 228 def critical_capabilities_for(model) [ ('streaming' if streaming?(model)), ('function_calling' if functions?(model)), ('vision' if vision?(model)), ('embeddings' if (model)) ].compact end |
.embedding_model?(model) ⇒ Boolean
The one model-type predicate, shared with the discovery runner's build_offering_draft. The catalog path hands string-keyed wire hashes; the discovery path hands symbol-keyed JSON — both shapes resolve here.
214 215 216 217 218 219 220 |
# File 'lib/legion/extensions/llm/vllm/provider.rb', line 214 def (model) data = model.is_a?(Hash) ? model : {} type = data[:type] || data['type'] model_caps = data[:capabilities] || data['capabilities'] type.to_s == 'embedding' || (model_caps.is_a?(Array) && model_caps.include?('embedding')) end |
.embeddings?(model) ⇒ Boolean
226 |
# File 'lib/legion/extensions/llm/vllm/provider.rb', line 226 def (model) = (model) |
.functions?(_model) ⇒ Boolean
225 |
# File 'lib/legion/extensions/llm/vllm/provider.rb', line 225 def functions?(_model) = false |
.streaming?(model) ⇒ Boolean
223 |
# File 'lib/legion/extensions/llm/vllm/provider.rb', line 223 def streaming?(model) = !(model) |
.vision?(_model) ⇒ Boolean
224 |
# File 'lib/legion/extensions/llm/vllm/provider.rb', line 224 def vision?(_model) = false |