lex-llm-azure-foundry 0.2.5 → 0.2.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dc801cd438178d5431250e6b2dbfb3d2b6dce8af6fb7a266cd2bf65eeb24b7a9
4
- data.tar.gz: '04928abba688736869565f51365019a470980ddf4502d866d0a3f169bb30524b'
3
+ metadata.gz: be5a0deef7be2d2f074ec98ebb5a77ec065d46029c7d4a902479bdfc2044240d
4
+ data.tar.gz: 565fe0757d88c7f8289c919d721db319303e25ef906f96982fd18179d1135845
5
5
  SHA512:
6
- metadata.gz: 93d13277c3dfbe8bdb683f623d65800e8bedc771541573684f7181ff81fa49fb37f0a7c228aa87bf9f380f5685682760ba1e5b91720fb6e434bb9a28ae3c606c
7
- data.tar.gz: cca5a4ea13dde3029a3402cec8dd58ced8592572236d7646cd6162f27473a143f434838c7495d67ec366553b647b142d99981631a30a9136eed0785479fd4c29
6
+ metadata.gz: 3503088b0c52dedeb98dc49bdbf8006836e038a71c0b0600e5aaaa89302c0e10c4f9963de7d583445fc98910520bd1bed89793b9c9776b7e95cf0d0b6d3d9215
7
+ data.tar.gz: bc52d6be469507ffa3fd886ccab511c345d34c568432b2e94c8e6f89c302d597d12f1fffffa61e2e6206f25e149c0590180c2d40ff28d6a17ad5c9baec3071ec
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.6 - 2026-05-21
4
+
5
+ - Add `default_transport`/`default_tier` class declarations, remove `configured_transport`/`configured_tier`
6
+ - Add `model_allowed?` filtering in `discover_offerings`
7
+ - Default tier set to :cloud
8
+ - Identity headers included via base provider
9
+
10
+
3
11
  ## 0.2.5 - 2026-05-06
4
12
 
5
13
  - Load provider-owned fleet actors through the LegionIO subscription base and the canonical Azure Foundry provider root.
@@ -18,6 +18,8 @@ module Legion
18
18
 
19
19
  class << self
20
20
  def slug = 'azure_foundry'
21
+ def default_transport = :http
22
+ def default_tier = :cloud
21
23
  def configuration_requirements = %i[azure_foundry_endpoint]
22
24
 
23
25
  def configuration_options
@@ -128,10 +130,10 @@ module Legion
128
130
  end
129
131
 
130
132
  def headers
131
- {
133
+ identity_headers.merge({
132
134
  'api-key' => config.azure_foundry_api_key,
133
135
  'Authorization' => bearer_header
134
- }.compact
136
+ }.compact)
135
137
  end
136
138
 
137
139
  def completion_url = path_for('chat/completions')
@@ -143,10 +145,10 @@ module Legion
143
145
 
144
146
  def discover_offerings(live: false, **filters)
145
147
  log.info { "discovering offerings live=#{live} from #{api_base}" }
146
- offerings = configured_deployments.filter_map { |deployment| offering_from_config(deployment) }
147
- return filter_offerings(offerings, **filters) unless live
148
+ offerings = filter_offerings(allowed_offerings, **filters)
149
+ return offerings unless live
148
150
 
149
- filter_offerings(offerings, **filters).map do |offering|
151
+ offerings.map do |offering|
150
152
  with_live_metadata(offering)
151
153
  rescue StandardError => e
152
154
  handle_exception(e, level: :warn, handled: true, operation: 'azure_foundry.discover_offerings')
@@ -300,6 +302,18 @@ module Legion
300
302
  self.class.normalize_deployments(config.azure_foundry_deployments)
301
303
  end
302
304
 
305
+ def allowed_offerings
306
+ configured_deployments.filter_map do |deployment|
307
+ offering = offering_from_config(deployment)
308
+ next unless offering
309
+
310
+ mid = offering.respond_to?(:model) ? offering.model : (offering[:model] || deployment[:model])
311
+ next unless model_allowed?(mid.to_s)
312
+
313
+ offering
314
+ end
315
+ end
316
+
303
317
  def offering_from_config(deployment)
304
318
  deployment_name = value_for(deployment, :deployment) || value_for(deployment, :model)
305
319
  return nil if deployment_name.to_s.empty?
@@ -319,8 +333,8 @@ module Legion
319
333
  Legion::Extensions::Llm::Routing::ModelOffering.new(
320
334
  provider_family: :azure_foundry,
321
335
  instance_id: instance_id,
322
- transport: configured_transport(:http),
323
- tier: configured_tier(:frontier),
336
+ transport: offering_transport,
337
+ tier: offering_tier,
324
338
  model: model,
325
339
  usage_type: usage_type.to_sym,
326
340
  capabilities: capabilities,
@@ -332,14 +346,6 @@ module Legion
332
346
  )
333
347
  end
334
348
 
335
- def configured_transport(default)
336
- config.respond_to?(:transport) ? config.transport : default
337
- end
338
-
339
- def configured_tier(default)
340
- config.respond_to?(:tier) ? config.tier : default
341
- end
342
-
343
349
  def with_live_metadata(offering)
344
350
  response = connection.get(models_url)
345
351
  metadata = offering.metadata.merge(model_info: response.body)
@@ -4,7 +4,7 @@ module Legion
4
4
  module Extensions
5
5
  module Llm
6
6
  module AzureFoundry
7
- VERSION = '0.2.5'
7
+ VERSION = '0.2.6'
8
8
  end
9
9
  end
10
10
  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.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - LegionIO