LlmCreationRequest
Rust struct goodmem::models::LlmCreationRequest: declaration, fields or variants, and implementations.
Struct LlmCreationRequest
goodmem::models::LlmCreationRequest
Request body for creating a new LLM. An LLM represents a configuration for text generation services.
pub struct LlmCreationRequest {
pub display_name: String,
pub description: Option<String>,
pub provider_type: LlmProviderType,
pub endpoint_url: String,
pub api_path: Option<String>,
pub model_identifier: String,
pub supported_modalities: Option<Vec<Modality>>,
pub credentials: Option<Box<EndpointAuthentication>>,
pub labels: Option<BTreeMap<String, String>>,
pub version: Option<String>,
pub monitoring_endpoint: Option<String>,
pub capabilities: Option<Box<LlmCapabilities>>,
pub default_sampling_params: Option<Box<LlmSamplingParams>>,
pub max_context_length: Option<i32>,
pub client_config: Option<BTreeMap<String, serde_json::Value>>,
pub owner_id: Option<String>,
pub llm_id: Option<String>,
pub dashscope_api_dialect: Option<DashScopeApiDialect>,
}Referenced types: DashScopeApiDialect, EndpointAuthentication, LlmCapabilities, LlmProviderType, LlmSamplingParams, Modality.
Fields
display_name
pub display_name: String
User-facing name of the LLM
Wire name: displayName.
description
pub description: Option<String>
Description of the LLM
Wire name: description.
provider_type
pub provider_type: LlmProviderType
Type of LLM provider
Wire name: providerType.
endpoint_url
pub endpoint_url: String
API endpoint base URL (OpenAI-compatible base, typically ends with /v1)
Wire name: endpointUrl.
api_path
pub api_path: Option<String>
API path for chat/completions request (defaults to /chat/completions if not provided)
Wire name: apiPath.
model_identifier
pub model_identifier: String
Model identifier
Wire name: modelIdentifier.
supported_modalities
pub supported_modalities: Option<Vec<Modality>>
Supported content modalities (defaults to TEXT if not provided)
Wire name: supportedModalities.
credentials
pub credentials: Option<Box<EndpointAuthentication>>
Structured credential payload describing how to authenticate with the provider. Required for SaaS providers; optional for local or proxy providers.
Wire name: credentials.
labels
pub labels: Option<BTreeMap<String, String>>
User-defined labels for categorization
Wire name: labels.
version
pub version: Option<String>
Version information
Wire name: version.
monitoring_endpoint
pub monitoring_endpoint: Option<String>
Monitoring endpoint URL
Wire name: monitoringEndpoint.
capabilities
pub capabilities: Option<Box<LlmCapabilities>>
LLM capabilities defining supported features and modes. Optional - server infers capabilities from model identifier if not provided.
Wire name: capabilities.
default_sampling_params
pub default_sampling_params: Option<Box<LlmSamplingParams>>
Default sampling parameters for generation requests
Wire name: defaultSamplingParams.
max_context_length
pub max_context_length: Option<i32>
Maximum context window size in tokens
Wire name: maxContextLength.
client_config
pub client_config: Option<BTreeMap<String, serde_json::Value>>
Provider-specific client configuration as flexible JSON structure
Wire name: clientConfig.
owner_id
pub owner_id: Option<String>
Optional owner principal UUID. If omitted, defaults to the authenticated principal. CREATE_LLM is evaluated against the proposed LLM and owner.
Wire name: ownerId.
llm_id
pub llm_id: Option<String>
Optional client-provided UUID for idempotent creation. If not provided, server generates a new UUID. Returns ALREADY_EXISTS if ID is already in use.
Wire name: llmId.
dashscope_api_dialect
pub dashscope_api_dialect: Option<DashScopeApiDialect>
DashScope request and response API dialect. Valid only for the DASHSCOPE provider. When omitted, a recognized apiPath determines the dialect; otherwise OPENAI_COMPATIBLE is used.
Wire name: dashscopeApiDialect.
Implementations
validate
pub fn validate(&self) -> crate::Result<()>
Validate the request before sending, without making an HTTP call.
from_model
pub fn from_model(model: &str, api_key: Option<&str>) ->Result<Self>
Fill known provider defaults; explicit request structs support custom models.
Trait implementations
Clone(derived)Default(derived)PartialEq(derived)Serialize(derived)impl<'de> Deserialize<'de> for LlmCreationRequestimpl std::fmt::Debug for LlmCreationRequest