Files
privateGPT/tests
JulianS1987 c120a90603 fix: make embedding API key optional for local OpenAI-compatible engines (#2261)
Ingesting documents with a local OpenAI-compatible embedding engine (Ollama,
vLLM, ...) failed with `openai.OpenAIError: Missing credentials` when no API
key was configured. The OpenAI-like embedding factory forwarded an empty
api_key straight to the OpenAI client, which rejects empty credentials at
request time.

Chat already tolerates a missing key (completions/openailike.py uses
`... or "default"`) and so does the embedding discovery probe
(`... or "no-key"`); only the embedding factory lacked the fallback, so model
discovery and chat worked while the first real embedding call (ingestion)
crashed.

Mirror the chat behaviour with a placeholder key on the local
OpenAI-compatible path. The strict api.openai.com path is unchanged and still
requires a real key.

Fixes #2260

Co-authored-by: Julian Siegrist <jsiegrist@immomio.de>
2026-06-08 08:09:15 +02:00
..
2026-06-02 16:55:46 +02:00
2023-10-19 16:04:35 +02:00
2023-10-19 16:04:35 +02:00
2026-06-02 16:55:46 +02:00