lex-llm-vllm 0.2.6 → 0.2.7
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 +5 -0
- data/lib/legion/extensions/llm/vllm/version.rb +1 -1
- data/lib/legion/extensions/llm/vllm.rb +18 -2
- 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: 60cd8aa03dc672912cdd86dadd1dd869bcb0cea55187c29a06d6808850cf8b58
|
|
4
|
+
data.tar.gz: 26ec677b3b731fa5ab4fa024a4a046285d8ff7550bdb8ca3de92f35c1f71733c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0b790758768552288cbcb083c8b1b7a1892d6262223633ec36e50a014b2ebc9f75bb43bc4cb451aadfbbebe82dea33cbdff86129d2a90d4873b87ed5ec288d8d
|
|
7
|
+
data.tar.gz: 0e969eba8171a0dfb830137193173129da7b051a9d84902ee9275fc5bcf8602a3c634a2b26c464e7e8b7dc17216c8d971f899c20144dcf535cdffb798743de19
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.7 - 2026-05-07
|
|
4
|
+
|
|
5
|
+
- Fix merge order in `discover_instances` so a user-supplied `tier:` in instance config is no longer clobbered by the `:direct` default.
|
|
6
|
+
- Infer instance tier from endpoint URL in `normalize_instance_config`: `localhost`/`127.0.0.1`/`::1` → `:local`, any other host → `:direct`. Explicit `tier:` in config still wins.
|
|
7
|
+
|
|
3
8
|
## 0.2.6 - 2026-05-06
|
|
4
9
|
|
|
5
10
|
- Load provider-owned fleet actors through the LegionIO subscription base and the canonical vLLM provider root.
|
|
@@ -14,6 +14,7 @@ module Legion
|
|
|
14
14
|
extend Legion::Extensions::Llm::AutoRegistration
|
|
15
15
|
|
|
16
16
|
PROVIDER_FAMILY = :vllm
|
|
17
|
+
DEFAULT_INSTANCE_TIER = { tier: :direct }.freeze
|
|
17
18
|
|
|
18
19
|
def self.default_settings
|
|
19
20
|
::Legion::Extensions::Llm.provider_settings(
|
|
@@ -60,7 +61,7 @@ module Legion
|
|
|
60
61
|
configured = CredentialSources.setting(:extensions, :llm, :vllm, :instances)
|
|
61
62
|
if configured.is_a?(Hash)
|
|
62
63
|
configured.each do |name, config|
|
|
63
|
-
instances[name.to_sym] = normalize_instance_config(config)
|
|
64
|
+
instances[name.to_sym] = DEFAULT_INSTANCE_TIER.merge(normalize_instance_config(config))
|
|
64
65
|
end
|
|
65
66
|
end
|
|
66
67
|
|
|
@@ -69,16 +70,31 @@ module Legion
|
|
|
69
70
|
|
|
70
71
|
def self.normalize_instance_config(config)
|
|
71
72
|
normalized = config.to_h.transform_keys(&:to_sym)
|
|
73
|
+
resolve_api_base_aliases(normalized)
|
|
74
|
+
normalized[:tier] ||= infer_tier_from_endpoint(normalized[:vllm_api_base])
|
|
75
|
+
normalized
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def self.resolve_api_base_aliases(normalized)
|
|
72
79
|
normalized[:vllm_api_base] ||= normalized.delete(:base_url)
|
|
73
80
|
normalized[:vllm_api_base] ||= normalized.delete(:api_base)
|
|
74
81
|
normalized[:vllm_api_base] ||= normalized.delete(:endpoint)
|
|
75
82
|
normalized[:vllm_api_base] = normalize_api_base(normalized[:vllm_api_base]) if normalized[:vllm_api_base]
|
|
76
|
-
normalized
|
|
77
83
|
end
|
|
78
84
|
|
|
79
85
|
def self.normalize_api_base(url)
|
|
80
86
|
url.to_s.sub(%r{/v1/?\z}, '')
|
|
81
87
|
end
|
|
88
|
+
|
|
89
|
+
def self.infer_tier_from_endpoint(url)
|
|
90
|
+
return :direct if url.nil? || url.to_s.empty?
|
|
91
|
+
|
|
92
|
+
require 'uri'
|
|
93
|
+
host = URI.parse(url.to_s).host.to_s.downcase
|
|
94
|
+
%w[localhost 127.0.0.1 ::1].include?(host) ? :local : :direct
|
|
95
|
+
rescue URI::InvalidURIError
|
|
96
|
+
:direct
|
|
97
|
+
end
|
|
82
98
|
end
|
|
83
99
|
end
|
|
84
100
|
end
|