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
a9064c51
Unverified
Commit
a9064c51
authored
Mar 06, 2026
by
Schwinn Saereesitthipitak
Committed by
GitHub
Mar 06, 2026
Browse files
fix: hide inactive models from /v1/models (#6966)
parent
b07be71b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
15 deletions
+30
-15
lib/llm/src/discovery/model.rs
lib/llm/src/discovery/model.rs
+25
-0
lib/llm/src/discovery/model_manager.rs
lib/llm/src/discovery/model_manager.rs
+5
-15
No files found.
lib/llm/src/discovery/model.rs
View file @
a9064c51
...
@@ -152,6 +152,31 @@ impl Model {
...
@@ -152,6 +152,31 @@ impl Model {
.any
(|
entry
|
entry
.value
()
.has_videos_engine
())
.any
(|
entry
|
entry
.value
()
.has_videos_engine
())
}
}
/// Whether this model should be visible in /v1/models.
pub
fn
is_displayable
(
&
self
)
->
bool
{
let
has_serving_engine
=
|
ws
:
&
WorkerSet
|
{
ws
.has_chat_engine
()
||
ws
.has_completions_engine
()
||
ws
.has_embeddings_engine
()
||
ws
.has_images_engine
()
||
ws
.has_tensor_engine
()
||
ws
.has_videos_engine
()
};
let
has_any_serving_engine
=
self
.worker_sets
.iter
()
.any
(|
entry
|
{
let
ws
=
entry
.value
();
has_serving_engine
(
ws
.as_ref
())
});
self
.worker_sets
.iter
()
.any
(|
entry
|
{
let
ws
=
entry
.value
();
if
ws
.worker_count
()
==
0
{
return
false
;
}
has_serving_engine
(
ws
.as_ref
())
||
(
!
has_any_serving_engine
&&
ws
.is_prefill_set
())
})
}
/// Check if a candidate checksum is valid for this model.
/// Check if a candidate checksum is valid for this model.
/// Returns `Some(true)` if it matches the canonical checksum, `Some(false)` if it
/// Returns `Some(true)` if it matches the canonical checksum, `Some(false)` if it
/// doesn't match, or `None` if no canonical checksum has been set yet (no WorkerSets).
/// doesn't match, or `None` if no canonical checksum has been set yet (no WorkerSets).
...
...
lib/llm/src/discovery/model_manager.rs
View file @
a9064c51
...
@@ -194,21 +194,11 @@ impl ModelManager {
...
@@ -194,21 +194,11 @@ impl ModelManager {
}
}
pub
fn
model_display_names
(
&
self
)
->
HashSet
<
String
>
{
pub
fn
model_display_names
(
&
self
)
->
HashSet
<
String
>
{
let
mut
names
=
HashSet
::
new
();
self
.models
for
entry
in
self
.models
.iter
()
{
.iter
()
let
model
=
entry
.value
();
.filter
(|
entry
|
entry
.value
()
.is_displayable
())
if
model
.has_chat_engine
()
.map
(|
entry
|
entry
.key
()
.clone
())
||
model
.has_completions_engine
()
.collect
()
||
model
.has_embeddings_engine
()
||
model
.has_images_engine
()
||
model
.has_tensor_engine
()
||
model
.has_videos_engine
()
||
model
.has_prefill
()
{
names
.insert
(
entry
.key
()
.clone
());
}
}
names
}
}
pub
fn
list_chat_completions_models
(
&
self
)
->
Vec
<
String
>
{
pub
fn
list_chat_completions_models
(
&
self
)
->
Vec
<
String
>
{
...
...
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