pub struct NodeModelConfig {
pub name: String,
pub provider: Option<Provider>,
pub path: String,
pub source: ModelSource,
pub version: Option<i32>,
pub confidence_threshold: Option<f32>,
}Expand description
A node’s reference to the on-disk model it should load - shared/reserved across every
built-in node that has this concept (object-detector, image-classifier, rl), moved
onto crate::node_config_base::NodeConfigBase (LAB-4384 follow-up) the same way
relay_topics already was, rather than each of those nodes re-declaring its own
near-identical ModelConfig struct.
This is deliberately a different type from ModelConfig above: that one is the model
catalog’s own on-disk metadata (models/catalog/<name>/config.json - task, repo, filename,
preprocessing, labels); this one is a node’s pointer to a model (which one, where its file
lives, where to resolve it from), a completely different concept that happens to share the
word “model”.
name/path default to the empty string rather than this type baking in any one node’s
real default value (object-detector defaults to "yolov8n", rl to "find-target",
image-classifier to "mobilenet-v2" - genuinely different per node). Each node resolves its
own real default for an empty value itself (see each node’s own model() accessor on its
Config type) - this mirrors exactly how #[serde(default)] on this struct’s own fields
already behaved before this type was shared (calling Default::default(), not a per-node
default function, when the field - or the whole model key - is merely absent).
confidence_threshold only has meaning for image-classifier today (object-detector/rl
ignore it) - it lives here rather than as a image-classifier-only extra field so this
struct stays the single shared shape for the “which model does this node use” concept across
all three nodes rather than splintering into near-identical siblings again.
provider only has meaning for llm-command (object-detector/image-classifier/rl ignore
it) - it used to be a separate field on NodeConfigBase alongside model, but “which
backend resolves this model” is part of the same “which model does this node use” concept,
so it consolidated into this one struct instead of two separate Option fields on the base.
Fields§
§name: StringName of the model to load. Empty means “not set” - the owning node resolves its own default in that case.
provider: Option<Provider>Which LLM backend to query (llm-command-specific; ignored by other nodes using this
type). None means “not set” - the owning node resolves its own default in that case.
path: StringFilesystem path to the model file. Empty means “not set” - the owning node resolves its own default in that case.
source: ModelSourceWhere to resolve the model from.
version: Option<i32>Specific model version to use (registry-sourced models only); latest if omitted.
confidence_threshold: Option<f32>Minimum confidence score a classification result must meet to be reported
(image-classifier-specific; ignored by other nodes using this type).
Trait Implementations§
Source§impl Clone for NodeModelConfig
impl Clone for NodeModelConfig
Source§impl Debug for NodeModelConfig
impl Debug for NodeModelConfig
Source§impl Default for NodeModelConfig
impl Default for NodeModelConfig
Source§impl<'de> Deserialize<'de> for NodeModelConfig
impl<'de> Deserialize<'de> for NodeModelConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for NodeModelConfig
impl JsonSchema for NodeModelConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for NodeModelConfig
impl PartialEq for NodeModelConfig
Source§impl Serialize for NodeModelConfig
impl Serialize for NodeModelConfig
impl StructuralPartialEq for NodeModelConfig
Auto Trait Implementations§
impl Freeze for NodeModelConfig
impl RefUnwindSafe for NodeModelConfig
impl Send for NodeModelConfig
impl Sync for NodeModelConfig
impl Unpin for NodeModelConfig
impl UnsafeUnpin for NodeModelConfig
impl UnwindSafe for NodeModelConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more