Expand description
Define APIs for chat completion.
Structs§
- Model
Lock Guard - RAII guard for model lock. Automatically releases the lock when dropped. Used by non-stream mode to ensure lock release even on early return or panic.
- Model
Stream Lock - Per-model stream lock state. Each model has its own lock to allow parallel inference across different models.
Functions§
- chat
- Processes a chat-completion request and returns either a stream of ChatCompletionChunk instances or a ChatCompletionObject instance.
- get_
default_ model_ lock - Get the lock for the default model (first available model). Used when the request does not specify a model name.
- get_
or_ create_ model_ lock - Get or create a stream lock for the specified model.