GPT4Free aggregates many language-model and media providers behind a Python library, optional web GUI, and OpenAI-compatible FastAPI server. Docker images support full or slim deployments.
Overview
GPT4Free (g4f) is a community project that routes requests across numerous LLM and media-generation adapters so developers can experiment from one codebase. It ships a synchronous and async Python client, a browser-facing GUI, an OpenAI-compatible inference API, a JavaScript client distributed for browser use, and optional MCP server tools for search, scraping, and image generation.
Docker is documented as the recommended install path, with full and slim images for x86_64 and arm64, plus an optional sandbox desktop image with a VNC-style environment for provider logins. Users can install via pip, run the GUI or API from the CLI, and persist cookies, HAR files, and generated media in mounted directories. Some providers need Chrome automation or API keys.
Python 3.10 or newer is recommended. The project documents provider overview, local inference hooks, streaming patterns, and contribution steps for new adapters. Conversations are stored locally by default according to the security notes.
Key features
- Python sync and async clients
- OpenAI-compatible FastAPI API
- Optional local web GUI
- Docker full and slim images
- Browser JS client distribution
- MCP server for tools
- Multi-provider model adapters
- Image and media generation hooks
Use cases
- Unified access to many LLM providers
- Self-hosted OpenAI-compatible API
- Local GUI chat experimentation
- MCP-enabled agent tooling