Skip to main content

Crate chat_completions

Crate chat_completions 

Source
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§

ChatFailure
CompletionsBuilder
CompletionsClient
Request
An outbound request to be sent by a transport.
ReqwestTransport
HTTP transport backed by reqwest.
Response
The response returned by a transport for a unary (non-streaming) call.
WithModel
WithUrl
WithoutModel
WithoutUrl

Enums§

ChatError
TransportError

Traits§

Transport
A pluggable transport layer for sending requests and receiving responses or event streams.