Skip to main content

client.chat.complete()

Send a chat completion request and return the full response.

Parameters

str
required
Model ID. Example: "kf-reasoning-10b".
List[dict]
required
Conversation history as a list of {"role": ..., "content": ...} dicts. Roles: "user", "assistant", "system".
str
System prompt. Prepended automatically as a system message.
int
Maximum tokens to generate. Default 1024.
float
Sampling temperature between 0.0 and 2.0. Default 0.7.
float
Nucleus sampling probability. Default 1.0.
dict
Any additional parameters passed through to the API.

Returns: ChatCompletion

Each Choice: Message has role and content fields.

client.chat.stream()

Send a streaming chat request. Returns a ChatStream context manager.

Parameters

Same as complete().

Returns: ChatStream

Use as a context manager and iterate over StreamChunk objects. Each StreamChunk: