openai.GenericClient$stream
Any OpenAI-compatible chat-completions endpoint: vLLM, LM Studio, TGI, llama.cpp, Together, Fireworks, a corporate gateway.
Reference version
Signature
class openai.GenericClient$streamAny OpenAI-compatible chat-completions endpoint: vLLM, LM Studio, TGI, llama.cpp, Together, Fireworks, a corporate gateway.
Two things separate it from openai.ChatClient:
base_urlis REQUIRED. An unset base URL is a configuration error, not a silent fallback to api.openai.com — sending a private prompt to OpenAI because a variable was unset is the worse failure.- all-text messages are sent as
content: "…"rather thancontent: [{"type":"text",…}]. Many compatible servers reject the array form outright; media-bearing messages still use parts. It also sends nostream_options(undocumented outside first-party OpenAI) and requires no credential — a local server usually has none.
Source:<builtin>/openai/generic.bamlbytes 0–0
Fields
model
string | nullbase_url
ai.Credential$stream | nullapi_key
ai.Credential$stream | nullrequest_timeout_ms
int | nulltime_to_first_token_timeout_ms
int | nullrequest_body
baml.json.json$stream | nullheaders
map<string, string> | nullquery_params
map<string, string> | nulltemperature
float | nullmax_tokens
int | nulltop_p
float | nullstop
string[] | nullseed
int | nullcapture_wire
bool | null