Expand description
Generic OpenAI-compatible Chat Completions client.
Targets the /v1/chat/completions wire format implemented by OpenAI,
Ollama, vLLM, llama.cpp, LiteLLM, Cerebras, Groq, Together, Fireworks,
and the rest of the OAI-compatible ecosystem. Bring your own base URL.
use chat_completions::CompletionsBuilder;
let client = CompletionsBuilder::new()
.with_base_url("http://localhost:8000/v1")
.with_model("my-model")
.with_api_key("sk-...")
.build();Structs§
- Chat
Failure - Completions
Builder - Completions
Client - Request
- An outbound request to be sent by a transport.
- Reqwest
Transport - HTTP transport backed by
reqwest. - Response
- The response returned by a transport for a unary (non-streaming) call.
- With
Model - WithUrl
- Without
Model - Without
Url
Enums§
Traits§
- Transport
- A pluggable transport layer for sending requests and receiving responses or event streams.