Add support for Ollama

Resolved 💬 1 comment Opened Apr 16, 2025 by moshtaghmaveddat Closed Apr 16, 2025

Description:
Currently, the OpenAI Python client is tightly coupled to the OpenAI API (requiring an API key and pointing to api.openai.com). It would be extremely valuable to enable first‑class support for Ollama, so that developers can seamlessly target local or self‑hosted models without the need for an OpenAI API key.

Use Cases:
• Offline development & testing: Work with local models (e.g. StarCoder, CodeLlama) served by Ollama on your machine or private network.
• Cost savings & privacy: Run inference on self‑hosted hardware without incurring OpenAI usage fees or sharing sensitive prompts/data externally.
• Flexible deployment: Switch between OpenAI’s hosted models and local Ollama endpoints via configuration, without changing application code.

!image

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗