Llms
Rust llms API reference: typed methods, request options, return values, and resource models.
goodmem::api::Llms
Access this service with client.llms().
pub struct Llms<'a> {
/* private fields */
}Methods
| Method | HTTP | Path |
|---|---|---|
create | POST | /v1/llms |
delete | DELETE | /v1/llms/{id} |
get | GET | /v1/llms/{id} |
list | GET | /v1/llms |
update | PUT | /v1/llms/{id} |
Errors and cancellation
Calls return Result<T>. See Error for validation, HTTP, transport, decoding, and timeout failures. Stream items can also return errors after the call succeeds.
Pagination helpers fetch pages when polled. Drop a page or event stream to cancel further work.
Implementations
impl Llms<'_>
create
pub async fn create(&self, body: &LlmCreationRequest) ->Result<CreateLlmResponse>
Create a new LLM
Creates a new LLM configuration for text generation services. LLMs represent connections to different language model API services (like OpenAI, vLLM, etc.) and include all the necessary configuration to use them for text generation.
DUPLICATE DETECTION: Returns HTTP 409 Conflict (ALREADY_EXISTS) if another LLM exists with the same effective provider connection and model configuration for this owner after endpoint canonicalization and provider-default resolution. Equivalent credentials participate in the comparison. The apiPath field defaults to '/chat/completions' if omitted.
OWNER DEFAULTS: Owner defaults to the authenticated principal unless ownerId is provided; CREATE_LLM is evaluated against the proposed LLM and owner.
Errors include local validation, HTTP failures, and malformed responses.
HTTP: POST /v1/llms
delete
pub async fn delete(&self, id: impl std::fmt::Display) ->Result<()>
Delete an LLM
Permanently deletes an LLM configuration. This operation cannot be undone and removes the LLM record and securely deletes stored credentials.
IMPORTANT: This does NOT invalidate or delete any previously generated content using this LLM - existing generations remain accessible. Requires DELETE_LLM on the requested LLM.
Errors include local validation, HTTP failures, and malformed responses.
HTTP: DELETE /v1/llms/{id}
get
pub async fn get( &self, id: impl std::fmt::Display, options: &LlmsGetOptions, ) ->Result<LlmResponse>
Get an LLM by ID
Retrieves the details of a specific LLM configuration by its unique identifier. Requires READ_LLM on the requested LLM. The service distinguishes a missing LLM from an existing LLM the caller cannot read. This is a read-only operation with no side effects.
Errors include local validation, HTTP failures, and malformed responses.
HTTP: GET /v1/llms/{id}
list
pub async fn list(&self, options: &LlmsListOptions) ->Result<ListLlMsResponse>
List LLMs
Retrieves a list of LLM configurations accessible to the caller, with optional filtering.
LABEL FILTERS: Label filters accept either label.<key>=<value> or label[key]=value (for example, label.environment=production or label[environment]=production).
AUTHORIZATION: Requires LIST_LLM on the GoodMem instance. Each returned LLM must also be visible through READ_LLM; unauthorized LLMs are filtered in PostgreSQL. The ownerId parameter filters that already-authorized result set and does not grant additional visibility. This is a read-only operation with no side effects.
Errors include local validation, HTTP failures, and malformed responses.
HTTP: GET /v1/llms
update
pub async fn update( &self, id: impl std::fmt::Display, body: &LlmUpdateRequest, ) ->Result<LlmResponse>
Update an LLM
Updates an existing LLM configuration including display information, endpoint configuration, model parameters, credentials, and labels. All fields are optional - only specified fields will be updated.
SUPPORTED_MODALITIES UPDATE: If the array contains >=1 elements, it replaces the stored set; if empty or omitted, no change occurs and it does not count as an update by itself.
IMPORTANT: providerType is IMMUTABLE after creation and cannot be changed. Requires UPDATE_LLM on the requested LLM.
Errors include local validation, HTTP failures, and malformed responses.
HTTP: PUT /v1/llms/{id}
Types
CreateLlmResponseListLlMsResponseLlmCreationRequestLlmResponseLlmUpdateRequestLlmsGetOptionsLlmsListOptions
Trait implementations
Clone(derived)Copy(derived)Debug(derived)