-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
Problem
Users cannot point celeste at OpenAI-compatible or Anthropic-compatible APIs (MiniMax, vLLM, Ollama, LocalAI, etc.). The base_url parameter exists in method signatures (generate(), analyze(), stream.generate()) but never reaches _build_url() — it's dead plumbing.
Surfaced by #200.
Root Cause
_build_url() in both protocol clients (OpenResponsesClient, ChatCompletionsClient) reads from self._default_base_url (a ClassVar). The base_url parameter flows through namespace/modality layers but:
_predict()doesn't have an explicitbase_urlparam — it falls into**parameters- Protocol
_make_request()/_make_stream_request()don't havebase_urlas a named param — it falls into**parametersand is ignored _build_url()never sees it
Proposed Solution
Add protocol= + base_url= to create_client() and domain namespace methods:
# Anthropic-compatible (chatcompletions protocol)
await celeste.text.generate(
"Explain quantum computing",
model="MiniMax-M2.5",
protocol="chatcompletions",
base_url="https://api.minimax.io/anthropic",
api_key="your-key",
)
# OpenAI-compatible (openresponses protocol)
await celeste.text.generate(
"Hello",
model="lfm2:latest",
protocol="openresponses",
base_url="http://localhost:11434",
)Implementation
- Add
base_urltocreate_client()— store as instance attribute on the client _build_url()usesself._base_url or self._default_base_url- Add
protocol=as a way to select wire format without implying a provider identity - Relax model resolution when
base_urlis present —model + protocol + base_urlshould not hard-fail on unregistered models - Remove
base_urlfrom per-call method signatures (belongs on the client, not per-call) - Remove Ollama's custom
base_urlhandling inOllamaGenerateClient._make_request()— use the generic mechanism
Protocol mapping
| Protocol | Providers using it |
|---|---|
openresponses |
OpenAI, xAI, Ollama |
chatcompletions |
Anthropic, DeepSeek, Groq, HuggingFace, Mistral, Moonshot, Cerebras |
| Custom | Google (GenerateContent), Cohere |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels