lex-llm-vllm 0.3.14 → 0.3.17

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: '0459c715b28893afc32019e6f2f831ee08824cd3a0224c17fa25164f5f14a9fc'
4
- data.tar.gz: 72629182ec192e73316f29d1b491b471a1c8cfe6d87e348f2ce00a16f9df8a1b
3
+ metadata.gz: 142f55fe9f62c87ef3fe5fe545ba652ff73426af265aa9a0aaafa2bbb703ec35
4
+ data.tar.gz: ce24e483f5dea06abb6be25d26bedeaf531782b344500f73ed4fe1161e69c372
5
5
  SHA512:
6
- metadata.gz: 60b334c314c6f29257ae7c9a073dfc034536f50f4c58e620137d49d88fb682d12f1abb5882ae792e7a99faffabd3cb01ba990f053f341d10b5478952f527e6bd
7
- data.tar.gz: 3b602d7548c15a76068645d27da5a94619d7ca1954a2620c8291b2eb4af93384b2a4fe5f241b15487b3b8f7bb99a8294cd474ddac7f94ee1439d9e2d5f76ee08
6
+ metadata.gz: be6ebfd3ae8e78a9b0a64078cb7e947d08fb2f58cce8c61b5ea37a0181bcda83775d928b1f638e1518e9ca6640da196305203a169beeb746e6b13335b29f70a8
7
+ data.tar.gz: e74e87adb11b6d67071dfb053f72e3ef882fcf5f50b39e889b3d72071af3f41fe97fc524e89a6c20fe7606aea3e1db016d33459b965ea934aeeeb441c0b0dec1
data/.rubocop.yml CHANGED
@@ -21,11 +21,8 @@ RSpec/ExampleLength:
21
21
  Max: 8
22
22
  RSpec/MultipleExpectations:
23
23
  Enabled: false
24
-
25
24
  RSpec/ExampleLength:
26
- Max: 10
27
-
28
-
25
+ Enabled: false
29
26
  Layout/LineLength:
30
27
  Exclude:
31
28
  - spec/**/*
data/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.17] - 2026-08-04
4
+
5
+ ### Fixed
6
+ - Preserve each streamed tool call's wire index when bridging canonical vLLM chunks to legacy chunks, allowing `lex-llm` 0.6.16 to correlate interleaved argument fragments for parallel tool calls instead of attaching them by recency.
7
+
8
+ ## [0.3.16] - 2026-07-31
9
+
10
+ ### Fixed
11
+ - **`parse_chunk` now handles multiple tool_calls batched in a single SSE delta.** vLLM can batch several parallel tool_calls into one `choices[0].delta.tool_calls` array. Previously only `tool_calls.first` was processed — the 2nd+ tool calls were silently dropped, causing parallel tool invocations to lose calls. Now returns an array of `tool_call_delta` chunks (one per tool_call), which the streaming handler already iterates (per lex-llm 0.6.13). Single tool_call deltas still return a single chunk (not wrapped in an array) for backward compatibility.
12
+
13
+ ## [0.3.15] - 2026-07-31
14
+
15
+ ### Fixed
16
+ - **`to_legacy_chunk` now propagates `stop_reason` from canonical chunks.** The canonical translator correctly parsed vLLM's `finish_reason` into `Canonical::Chunk.stop_reason`, but `to_legacy_chunk` never passed it into the legacy `Legion::Extensions::Llm::Chunk` constructor. The `StreamAccumulator` already reads `chunk.stop_reason` (line 40), so the field was silently nil on every streamed chunk — downstream always defaulted to `:end_turn` regardless of what the provider actually said. Truncated responses (`:max_tokens`) and content-filtered responses (`:content_filter`) were indistinguishable from clean completions. Now the real finish_reason flows through: canonical chunk → legacy chunk → accumulator → assembled Message.
17
+
3
18
  ## [0.3.14] - 2026-07-24
4
19
 
5
20
  ### Fixed
data/lex-llm-vllm.gemspec CHANGED
@@ -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.6.9'
30
+ spec.add_dependency 'lex-llm', '>= 0.6.16'
31
31
  end
@@ -363,6 +363,7 @@ module Legion
363
363
  thinking: thinking,
364
364
  input_tokens: usage.respond_to?(:input_tokens) ? usage.input_tokens : nil,
365
365
  output_tokens: usage.respond_to?(:output_tokens) ? usage.output_tokens : nil,
366
+ stop_reason: canonical.stop_reason,
366
367
  raw: raw_data
367
368
  )
368
369
  end
@@ -370,7 +371,9 @@ module Legion
370
371
  # Map a canonical tool_call_delta onto the legacy chunk tool_calls hash.
371
372
  # Fragment semantics matter: an entry with a non-nil id starts a new tool
372
373
  # call in the StreamAccumulator; a nil id appends the raw arguments
373
- # fragment to the most recently started call.
374
+ # fragment to the call at its wire index (block_index). Carrying the
375
+ # index is what lets the accumulator correlate interleaved parallel
376
+ # fragments to the right call instead of falling back to recency.
374
377
  def legacy_chunk_tool_calls(canonical)
375
378
  return nil unless canonical.type == :tool_call_delta && canonical.tool_call
376
379
 
@@ -380,7 +383,8 @@ module Legion
380
383
  key => Legion::Extensions::Llm::ToolCall.new(
381
384
  id: tc.id,
382
385
  name: tc.name,
383
- arguments: tc.arguments
386
+ arguments: tc.arguments,
387
+ index: canonical.block_index
384
388
  )
385
389
  }
386
390
  end
@@ -172,8 +172,11 @@ module Legion
172
172
  log.debug '[vllm][translator] action=content_dropped_with_tool_call ' \
173
173
  "content=#{delta['content'][0, 100].inspect} request_id=#{request_id}"
174
174
  end
175
- return build_tool_call_delta_chunk(tool_calls.first, request_id,
176
- stop_reason: chunk_stop_reason, usage: chunk_usage)
175
+ chunks = tool_calls.map do |tc|
176
+ build_tool_call_delta_chunk(tc, request_id,
177
+ stop_reason: chunk_stop_reason, usage: chunk_usage)
178
+ end
179
+ return chunks.size == 1 ? chunks.first : chunks
177
180
  end
178
181
 
179
182
  # Thinking delta from reasoning_content
@@ -4,7 +4,7 @@ module Legion
4
4
  module Extensions
5
5
  module Llm
6
6
  module Vllm
7
- VERSION = '0.3.14'
7
+ VERSION = '0.3.17'
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-vllm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.14
4
+ version: 0.3.17
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.6.9
74
+ version: 0.6.16
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.6.9
81
+ version: 0.6.16
82
82
  description: vLLM provider integration for the LegionIO LLM routing framework.
83
83
  email:
84
84
  - matthewdiverson@gmail.com