mirror of
https://github.com/imartinez/privateGPT.git
synced 2026-07-16 17:00:12 +00:00
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>