lex-llm-azure-foundry 0.2.7 → 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 +15 -0
- data/Gemfile +0 -7
- data/lex-llm-azure-foundry.gemspec +1 -1
- data/lib/legion/extensions/llm/azure_foundry/actors/discovery_refresh.rb +7 -0
- data/lib/legion/extensions/llm/azure_foundry/provider.rb +62 -2
- data/lib/legion/extensions/llm/azure_foundry/version.rb +1 -1
- data/lib/legion/extensions/llm/azure_foundry.rb +3 -6
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7e151d90b17f955ff40511cc8e135f909ca7fd45d54147f357947bce824d04dd
|
|
4
|
+
data.tar.gz: c6972df094e1e34636cea4762ed40dd75737080231a4af3c21f1f4062676056d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3354eab641cb8026d825eb32b2a014316daa17b8fbccc659b067efc7d52c2ff999d3a624ecbca54773c50e36a83f0cea3bacc52a7e903c268010dbc81bfe5c2b
|
|
7
|
+
data.tar.gz: 15e2d75ed42617bdc0a9c49be74e42b09aaa70a5e9c45f12cae16320f78d33180058a233f64c043e012433b76021d69dd2dfdcd078502aa3727bfa203b64efb2
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.10 - 2026-06-16
|
|
4
|
+
|
|
5
|
+
- Dependency updates and code quality improvements.
|
|
6
|
+
|
|
7
|
+
## 0.2.9 - 2026-06-15
|
|
8
|
+
|
|
9
|
+
- **CapabilityPolicy integration** — Streaming from `:provider_envelope`; deployment metadata as `:model_metadata`. Settings overrides at provider/instance/model level supported.
|
|
10
|
+
|
|
11
|
+
## 0.2.8 - 2026-06-13
|
|
12
|
+
|
|
13
|
+
- **Gemfile cleanup** — Remove local path overrides; dependencies resolve from gemspec via rubygems.
|
|
14
|
+
- **Dependency bump** — Require `lex-llm >= 0.5.0` for canonical types support.
|
|
15
|
+
- **Capabilities** — Add canonical `:tools` to capability declarations.
|
|
16
|
+
- 26 examples, 0 failures; 13 files, 0 rubocop offenses.
|
|
17
|
+
|
|
3
18
|
## 0.2.7 - 2026-06-02
|
|
4
19
|
|
|
5
20
|
- Add per-provider scoped discovery refresh actor
|
data/Gemfile
CHANGED
|
@@ -2,13 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
source 'https://rubygems.org'
|
|
4
4
|
|
|
5
|
-
group :test do
|
|
6
|
-
llm_base_path = ENV.fetch('LEX_LLM_PATH', File.expand_path('../lex-llm', __dir__))
|
|
7
|
-
transport_path = ENV.fetch('LEGION_TRANSPORT_PATH', File.expand_path('../../legion-transport', __dir__))
|
|
8
|
-
gem 'legion-transport', path: transport_path if File.directory?(transport_path)
|
|
9
|
-
gem 'lex-llm', path: llm_base_path if File.directory?(llm_base_path)
|
|
10
|
-
end
|
|
11
|
-
|
|
12
5
|
gemspec
|
|
13
6
|
|
|
14
7
|
group :development do
|
|
@@ -27,5 +27,5 @@ Gem::Specification.new do |spec|
|
|
|
27
27
|
spec.add_dependency 'legion-logging', '>= 1.3.2'
|
|
28
28
|
spec.add_dependency 'legion-settings', '>= 1.3.14'
|
|
29
29
|
spec.add_dependency 'legion-transport', '>= 1.4.14'
|
|
30
|
-
spec.add_dependency 'lex-llm', '>= 0.
|
|
30
|
+
spec.add_dependency 'lex-llm', '>= 0.5.0'
|
|
31
31
|
end
|
|
@@ -36,6 +36,13 @@ module Legion
|
|
|
36
36
|
return unless defined?(Legion::LLM::Discovery)
|
|
37
37
|
|
|
38
38
|
Legion::LLM::Discovery.refresh_discovered_models!(provider: :azure_foundry)
|
|
39
|
+
|
|
40
|
+
if defined?(Legion::LLM::Router) && Legion::LLM::Router.respond_to?(:populate_auto_rules)
|
|
41
|
+
Legion::LLM::Router.populate_auto_rules(Legion::LLM::Discovery.discovered_instances)
|
|
42
|
+
end
|
|
43
|
+
if defined?(Legion::LLM::Inventory) && Legion::LLM::Inventory.respond_to?(:invalidate_offerings_cache!)
|
|
44
|
+
Legion::LLM::Inventory.invalidate_offerings_cache!
|
|
45
|
+
end
|
|
39
46
|
rescue StandardError => e
|
|
40
47
|
handle_exception(e, level: :warn, handled: true, operation: 'azure_foundry.actor.discovery_refresh')
|
|
41
48
|
end
|
|
@@ -329,7 +329,7 @@ module Legion
|
|
|
329
329
|
end
|
|
330
330
|
|
|
331
331
|
def build_offering(model:, model_family:, usage_type:, instance_id:, canonical_model_alias:, metadata:) # rubocop:disable Metrics/ParameterLists
|
|
332
|
-
|
|
332
|
+
policy = resolve_capability_policy(model, usage_type)
|
|
333
333
|
Legion::Extensions::Llm::Routing::ModelOffering.new(
|
|
334
334
|
provider_family: :azure_foundry,
|
|
335
335
|
instance_id: instance_id,
|
|
@@ -337,7 +337,8 @@ module Legion
|
|
|
337
337
|
tier: offering_tier,
|
|
338
338
|
model: model,
|
|
339
339
|
usage_type: usage_type.to_sym,
|
|
340
|
-
capabilities: capabilities,
|
|
340
|
+
capabilities: policy[:capabilities],
|
|
341
|
+
capability_sources: policy[:sources],
|
|
341
342
|
metadata: metadata.merge(
|
|
342
343
|
model_family: model_family,
|
|
343
344
|
canonical_model_alias: canonical_model_alias,
|
|
@@ -373,6 +374,65 @@ module Legion
|
|
|
373
374
|
deployment.to_h.transform_keys(&:to_sym).except(:deployment, :model_family, :usage_type)
|
|
374
375
|
end
|
|
375
376
|
|
|
377
|
+
def resolve_capability_policy(model, usage_type)
|
|
378
|
+
if usage_type.to_sym == :embedding
|
|
379
|
+
return { capabilities: %i[embeddings], sources: { embeddings: { value: true, source: :model_metadata } } }
|
|
380
|
+
end
|
|
381
|
+
|
|
382
|
+
real_caps = real_capabilities_for(model)
|
|
383
|
+
provider_cfg = provider_level_config
|
|
384
|
+
instance_cfg = instance_level_config
|
|
385
|
+
model_cfg = model_config_for(model)
|
|
386
|
+
|
|
387
|
+
Legion::Extensions::Llm::CapabilityPolicy.resolve(
|
|
388
|
+
real: real_caps,
|
|
389
|
+
provider_catalog: {},
|
|
390
|
+
probe: {},
|
|
391
|
+
provider_envelope: { streaming: true },
|
|
392
|
+
provider_config: provider_cfg,
|
|
393
|
+
instance_config: instance_cfg,
|
|
394
|
+
model_config: model_cfg
|
|
395
|
+
)
|
|
396
|
+
end
|
|
397
|
+
|
|
398
|
+
def real_capabilities_for(model)
|
|
399
|
+
caps = {}
|
|
400
|
+
caps[:streaming] = true if Capabilities.streaming?(model)
|
|
401
|
+
caps[:tools] = true if Capabilities.functions?(model)
|
|
402
|
+
caps[:vision] = true if Capabilities.vision?(model)
|
|
403
|
+
caps
|
|
404
|
+
end
|
|
405
|
+
|
|
406
|
+
def instance_level_config
|
|
407
|
+
if config.respond_to?(:to_h)
|
|
408
|
+
config.to_h
|
|
409
|
+
elsif config.respond_to?(:instance_variable_get)
|
|
410
|
+
data = config.instance_variable_get(:@data)
|
|
411
|
+
data.is_a?(Hash) ? data : {}
|
|
412
|
+
else
|
|
413
|
+
{}
|
|
414
|
+
end
|
|
415
|
+
end
|
|
416
|
+
|
|
417
|
+
def provider_level_config
|
|
418
|
+
cfg = Legion::Extensions::Llm::CredentialSources.setting(:extensions, :llm, :azure_foundry)
|
|
419
|
+
return {} unless cfg.is_a?(Hash)
|
|
420
|
+
|
|
421
|
+
cfg.except(:instances, 'instances')
|
|
422
|
+
rescue StandardError => e
|
|
423
|
+
handle_exception(e, level: :debug, handled: true, operation: 'azure_foundry.provider_level_config')
|
|
424
|
+
{}
|
|
425
|
+
end
|
|
426
|
+
|
|
427
|
+
def model_config_for(model)
|
|
428
|
+
provider_cfg = provider_level_config
|
|
429
|
+
models = provider_cfg[:models] || provider_cfg['models']
|
|
430
|
+
return {} unless models.is_a?(Hash)
|
|
431
|
+
|
|
432
|
+
model_id_str = Capabilities.model_id(model)
|
|
433
|
+
models[model_id_str.to_sym] || models[model_id_str] || {}
|
|
434
|
+
end
|
|
435
|
+
|
|
376
436
|
def capabilities_for(model, usage_type)
|
|
377
437
|
return %i[embedding] if usage_type.to_sym == :embedding
|
|
378
438
|
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
require 'legion/extensions/llm'
|
|
4
4
|
require 'legion/extensions/llm/azure_foundry/provider'
|
|
5
5
|
require 'legion/extensions/llm/azure_foundry/version'
|
|
6
|
+
require_relative 'azure_foundry/actors/discovery_refresh'
|
|
6
7
|
|
|
7
8
|
module Legion
|
|
8
9
|
module Extensions
|
|
@@ -36,10 +37,7 @@ module Legion
|
|
|
36
37
|
fleet: {
|
|
37
38
|
enabled: false,
|
|
38
39
|
respond_to_requests: false,
|
|
39
|
-
capabilities: %i[chat stream_chat embed]
|
|
40
|
-
lanes: [],
|
|
41
|
-
concurrency: 4,
|
|
42
|
-
queue_suffix: nil
|
|
40
|
+
capabilities: %i[chat stream_chat embed tools]
|
|
43
41
|
}
|
|
44
42
|
}
|
|
45
43
|
)
|
|
@@ -107,8 +105,7 @@ module Legion
|
|
|
107
105
|
private_class_method :discover_default_instance, :discover_named_instances, :add_named_instance,
|
|
108
106
|
:normalize_instance_config
|
|
109
107
|
|
|
110
|
-
Legion::Extensions::Llm::Configuration.register_provider_options(Provider.configuration_options)
|
|
111
|
-
Legion::Extensions::Llm::Configuration.respond_to?(:register_provider_options)
|
|
108
|
+
Legion::Extensions::Llm::Configuration.register_provider_options(Provider.configuration_options)
|
|
112
109
|
end
|
|
113
110
|
end
|
|
114
111
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lex-llm-azure-foundry
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- LegionIO
|
|
@@ -71,14 +71,14 @@ dependencies:
|
|
|
71
71
|
requirements:
|
|
72
72
|
- - ">="
|
|
73
73
|
- !ruby/object:Gem::Version
|
|
74
|
-
version: 0.
|
|
74
|
+
version: 0.5.0
|
|
75
75
|
type: :runtime
|
|
76
76
|
prerelease: false
|
|
77
77
|
version_requirements: !ruby/object:Gem::Requirement
|
|
78
78
|
requirements:
|
|
79
79
|
- - ">="
|
|
80
80
|
- !ruby/object:Gem::Version
|
|
81
|
-
version: 0.
|
|
81
|
+
version: 0.5.0
|
|
82
82
|
description: Azure AI Foundry and Azure OpenAI hosted provider integration for LegionIO
|
|
83
83
|
LLM routing.
|
|
84
84
|
email:
|