Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
dynamo
Commits
d9cc6f6b
Unverified
Commit
d9cc6f6b
authored
Jan 05, 2026
by
Yan Ru Pei
Committed by
GitHub
Jan 06, 2026
Browse files
feat: expected output tokens plumbing (#5181)
Signed-off-by:
PeaBrane
<
yanrpei@gmail.com
>
parent
f56483cb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
0 deletions
+13
-0
lib/llm/src/preprocessor.rs
lib/llm/src/preprocessor.rs
+1
-0
lib/llm/src/protocols/common/preprocessor.rs
lib/llm/src/protocols/common/preprocessor.rs
+5
-0
lib/llm/src/protocols/openai/nvext.rs
lib/llm/src/protocols/openai/nvext.rs
+7
-0
No files found.
lib/llm/src/preprocessor.rs
View file @
d9cc6f6b
...
@@ -246,6 +246,7 @@ impl OpenAIPreprocessor {
...
@@ -246,6 +246,7 @@ impl OpenAIPreprocessor {
decode_worker_id
:
nvext
.decode_worker_id
,
decode_worker_id
:
nvext
.decode_worker_id
,
dp_rank
:
None
,
// dp_rank is set later in the pipeline
dp_rank
:
None
,
// dp_rank is set later in the pipeline
enable_local_updates
:
nvext
.enable_local_updates
,
enable_local_updates
:
nvext
.enable_local_updates
,
expected_output_tokens
:
nvext
.expected_output_tokens
,
};
};
builder
.routing
(
Some
(
routing
));
builder
.routing
(
Some
(
routing
));
}
}
...
...
lib/llm/src/protocols/common/preprocessor.rs
View file @
d9cc6f6b
...
@@ -42,6 +42,11 @@ pub struct RoutingHints {
...
@@ -42,6 +42,11 @@ pub struct RoutingHints {
/// - `Some(false)`: External caller (e.g., GAIE sidecar) handles bookkeeping via C FFI
/// - `Some(false)`: External caller (e.g., GAIE sidecar) handles bookkeeping via C FFI
#[serde(default,
skip_serializing_if
=
"Option::is_none"
)]
#[serde(default,
skip_serializing_if
=
"Option::is_none"
)]
pub
enable_local_updates
:
Option
<
bool
>
,
pub
enable_local_updates
:
Option
<
bool
>
,
/// Expected number of output tokens for this request.
/// Used as a hint for routing decisions to estimate resource requirements.
#[serde(default,
skip_serializing_if
=
"Option::is_none"
)]
pub
expected_output_tokens
:
Option
<
u32
>
,
}
}
#[derive(Serialize,
Deserialize,
Debug,
Clone,
Default)]
#[derive(Serialize,
Deserialize,
Debug,
Clone,
Default)]
...
...
lib/llm/src/protocols/openai/nvext.rs
View file @
d9cc6f6b
...
@@ -116,6 +116,12 @@ pub struct NvExt {
...
@@ -116,6 +116,12 @@ pub struct NvExt {
#[builder(default,
setter(strip_option))]
#[builder(default,
setter(strip_option))]
#[serde(default,
skip_serializing_if
=
"Option::is_none"
)]
#[serde(default,
skip_serializing_if
=
"Option::is_none"
)]
pub
enable_local_updates
:
Option
<
bool
>
,
pub
enable_local_updates
:
Option
<
bool
>
,
/// Expected number of output tokens for this request.
/// Used as a hint for routing decisions to estimate resource requirements.
#[builder(default,
setter(strip_option))]
#[serde(default,
skip_serializing_if
=
"Option::is_none"
)]
pub
expected_output_tokens
:
Option
<
u32
>
,
}
}
impl
Default
for
NvExt
{
impl
Default
for
NvExt
{
...
@@ -165,6 +171,7 @@ mod tests {
...
@@ -165,6 +171,7 @@ mod tests {
assert_eq!
(
nv_ext
.prefill_worker_id
,
None
);
assert_eq!
(
nv_ext
.prefill_worker_id
,
None
);
assert_eq!
(
nv_ext
.decode_worker_id
,
None
);
assert_eq!
(
nv_ext
.decode_worker_id
,
None
);
assert_eq!
(
nv_ext
.enable_local_updates
,
None
);
assert_eq!
(
nv_ext
.enable_local_updates
,
None
);
assert_eq!
(
nv_ext
.expected_output_tokens
,
None
);
}
}
// Test valid builder configurations
// Test valid builder configurations
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment