
FastChat
Platform to train, serve, and evaluate LLM chatbots
Provides model serving with a web UI and OpenAI-compatible APIs, plus training and benchmark tooling for conversational models such as Vicuna.
OpenAI API by OpenAI is a commercial product. These open-source projects say they can replace it.
The most popular open-source alternative to OpenAI API is Ollama, with 188.3k GitHub stars. Other open-source alternatives to OpenAI API are llama.cpp, vLLM, LocalAI and FastChat. Most OpenAI API alternatives here are Machine Learning Infrastructure tools. The first 1 say in their own README or website that they can replace OpenAI API (the quote is shown under each one); the other 4 do the same job, shown with their own description.
Stars and activity updated 27 November 2026.

Platform to train, serve, and evaluate LLM chatbots
Provides model serving with a web UI and OpenAI-compatible APIs, plus training and benchmark tooling for conversational models such as Vicuna.
“FastChat provides OpenAI-compatible APIs for its supported models, so you can use FastChat as a local drop-in replacement for OpenAI APIs.”
These projects don't call themselves a OpenAI API alternative, but two independent checks of their own description found they do the same main job.

Run open AI models locally or in the cloud
Ollama runs open language models such as Gemma, Qwen, DeepSeek and gpt-oss on macOS, Windows and Linux, locally or in the cloud. It offers a CLI, a REST API, and Python and JavaScript libraries.
“Ollama is the easiest way to run and build with open AI models locally or in the cloud on macOS, Windows, and Linux.”

LLM inference engine in C/C++ for local and cloud hardware
llama.cpp runs large language models and multimodal models locally or in the cloud with minimal setup. It includes a CLI, an OpenAI-compatible server with a built-in chat app, and a C library API.
“Run the latest open models on your computer. Chat with them, or connect them to your coding agents, editors, and apps. Free, private, and nothing to configure.”

High-throughput, memory-efficient inference and serving engine for LLMs
vLLM is a library and server for running and serving large language models. It uses PagedAttention and continuous batching for throughput, offers an OpenAI-compatible API, and runs on many GPU, CPU and accelerator types.
“vLLM is a high-throughput and memory-efficient inference and serving engine for Large Language Models (LLMs). Deploy AI models faster with state-of-the-art performance. Easy, fast, and cost-efficient LLM serving for everyone.”

Self-hosted OpenAI-compatible server for running open AI models locally
LocalAI runs open models for chat, images, speech, video and music on your own hardware, with OpenAI- and Anthropic-compatible APIs. It works on CPU or GPU and adds team chats, files, agents and add-ons.
“The API speaks the OpenAI and Anthropic formats.”
Yes. 5 open-source projects can replace OpenAI API, for example Ollama, llama.cpp and vLLM. 1 of them says so in its own documentation; the other 4 do the same job.
Ollama (188.3k GitHub stars) is the most popular open-source alternative to OpenAI API on GitHub. LocalAI has the most recent code changes. To run it on your own server, look at Ollama, vLLM and LocalAI, which are self-hostable. The best choice depends on your needs: compare them side by side, for example Ollama vs llama.cpp.
All of the 5 projects listed here are free to use under an open-source license, with no license fee: all permissive (such as MIT). Running software on your own server still costs hosting and upkeep, and many projects also sell a hosted version.