Model or dataset
OEvortex/llm4free avatar
OEvortex/llm4free

LLM4Free puts 40+ providers behind the OpenAI chat.completions call you already write

LLM4Free — All-in-one Python toolkit for web search, AI interaction (40+ free providers), digital utilities, and more. Formerly WebScout.

372 stars72 forksPythonApache-2.0

At a glance

What is it?
A Python toolkit where every provider implements client.chat.completions.create the way the OpenAI SDK does, with model="auto" resolving a working backend and failing over when one dies. The included API server binds 0.0.0.0 on port 8000 with authentication disabled by default, and the Docker image installs from git rather than from PyPI.
Who is it for?
Adopt LLM4Free if you want one import path across many free and paid providers, you are willing to check last_provider when quality matters, and you read the API server's defaults before exposing it.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 17 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 4, 2026, and from our analysis. They are not legal advice.

Editorial analysis

model="auto" picks a provider, and last_provider tells you which one it picked

The core promise is interface compatibility. Every chat provider implements client.chat.completions.create(...), identical to the OpenAI Python SDK, so switching providers is a change of one line rather than a rewrite.

On top of that sits a unified Client that adds two things the raw providers do not do.

python
from llm4free.client import Client

client = Client(print_provider_info=True)
response = client.chat.completions.create(
    model="auto",
    messages=[{"role": "user", "content": "Explain quantum computing in simple terms"}],
)
print(response.choices[0].message.content)

The first is model resolution. Use model="auto" and the client picks a working provider and model for you; use model="Provider/Model", for example "HeckAI/google/gemini-2.5-flash-preview", to force one.

The second is failover. The Client retries across providers, which the documentation frames as not having 3am outages from a dead endpoint.

Both features come with an answer to the obvious question, which is what did it actually use. client.chat.completions.last_provider names the provider that served the request, and print_provider_info=True prints it live at construction.

That attribute matters more than it first appears. With auto resolution and silent failover, a response can come from a different model than the one you would have chosen, and the only way to know is to look.

Zero-key providers are the easy entry, and they are also the unpredictable one

The free tier is the pitch: use HeckAI, Pollinations and others with zero API key, then graduate to Groq, DeepInfra or your own key when you need scale.

The zero-key path is genuinely the simplest thing in the project. A raw provider needs nothing but an import.

python
from llm4free.llm.heckai import HeckAI

client = HeckAI()
response = client.chat.completions.create(
    model="google/gemini-2.5-flash-preview",
    messages=[{"role": "user", "content": "Explain quantum computing in simple terms"}],
)
print(response.choices[0].message.content)

No key, no account, no configuration file. The documentation recommends the unified Client over this route precisely because the raw call adds no failover and no model resolution.

The trade is that a keyless endpoint is also the one whose availability and behaviour you control least, and auto-failover will move you off it without asking. A caller that pins Provider/Model has a stable answer; a caller using auto has a variable one.

So the practical rule is boring and worth stating: use auto for exploration, pin a specific backend for anything whose output you care about, and read last_provider when you are diagnosing why two identical calls gave different quality.

The bundled API server listens on 0.0.0.0:8000 with authentication disabled

The OpenAI-compatible server is the most useful thing here and the most dangerous default.

The compose file sets its environment like this.

bash
LLM4FREE_HOST=0.0.0.0
LLM4FREE_PORT=8000
LLM4FREE_WORKERS=1

Next to that group the file carries a comment that is worth reading twice. Authentication is currently disabled by default in the server, and the authentication and rate limiting settings may not be fully supported by the server yet.

That means a default deployment is an unauthenticated, effectively unthrottled endpoint on all interfaces, fronting 40 providers that cost nothing to call. There is also a docker-compose.no-auth.yml variant in the repository, which tells you the no-auth posture was considered explicit enough to have a file for it.

The metadata variables are conventional FastAPI ones: an API title, a description, a version of 0.2.0, docs at /docs, redoc at /redoc and the OpenAPI schema at /openapi.json, with a data directory at /app/data. LLM4FREE_CORS_ORIGIN is present, and LLM4FREE_DEFAULT_PROVIDER and LLM4FREE_BASE_URL are in the file but commented out.

Pointing the official OpenAI SDK at your laptop is the intended use, and that works fine on loopback. The moment the host is 0.0.0.0 it is not a laptop experiment any more.

The Docker image installs from git, so an unpinned build follows the branch

The Dockerfile is a multi-stage build on python:3.11-slim with build-essential, gcc, git and curl installed, then a virtual environment at /opt/venv, then the package installed into it.

The line that decides what your image contains is the install command.

bash
pip install git+https://github.com/OEvortex/LLM4Free.git#egg=llm4free[api]

That installs from the git repository, not from PyPI, and it is what the else branch pins with an explicit ref when LLM4FREE_VERSION is not latest. The practical consequence: a docker build with no build argument produces whatever is at the branch head at that moment, and two builds a week apart are not the same image.

The build arguments exist for exactly this reason. The compose file passes LLM4FREE_VERSION, BUILD_DATE, VCS_REF and VERSION into the build, which is the mechanism for making a build reproducible.

Production dependencies are then layered on top: gunicorn with the gthread worker and uvicorn with standard extras, plus a metrics package, and the compose file restarts the container unless stopped. docs/DOCKER.md covers the deployment options including compose profiles, so there is more than one way to run this once you leave the single-container case.

pip, uv and Docker, and only uv run works without installing anything

Three doors, and the extras matter because the server is not in the base package.

bash
pip install -U llm4free
pip install -U "llm4free[api]"
pip install -U "llm4free[dev]"

The api extra pulls the OpenAI-compatible server, and the dev extra the development tools. Installing the bare package and then expecting a server is the most likely first-run surprise.

The uv route is marked recommended.

bash
uv add llm4free
uv run llm4free --help
uv tool install llm4free

Three modes in three lines: add it to a project, run it without installing at all, or install the command line as a global tool.

Docker is the third door.

bash
docker pull OEvortex/llm4free:latest
docker run -it OEvortex/llm4free:latest

The command line interface sits on top of all of this, powered by Rich, and covers search, chat and generation.

One version detail: the package requires Python 3.10 or newer, while the classifiers enumerate 3.10 through 3.13 individually. There is no upper bound in requires-python, so a 3.14 install is not blocked by the metadata even though nobody has classified it.

Search, images and voice reuse the same shape, and the search API returns dicts

The non-chat parts of the toolkit are not a separate design.

Web search goes through one API across DuckDuckGo, Bing, Brave, Yahoo, Mojeek and Wikipedia, and it returns plain dictionaries.

python
from llm4free import DuckDuckGoSearch

search = DuckDuckGoSearch()
results = search.text("best practices for API design", max_results=5)

Each result carries a title and an href, which is worth noting because it means search output does not need an SDK to consume.

Images ride the same client. client.images.generate(...) has images.create(...) as an alias, takes model="auto" for provider selection and failover or a pinned Provider/Model, and a direct provider import works too, for example PollinationsAI from the TTI provider namespace with response_format="url". Text-to-image backends named in the README include Pollinations, Together and Stable Horde, and text-to-speech includes ElevenLabs, OpenAI FM, Qwen and Murf.

The remaining feature list is the developer toolbox: a web crawler called Scout, a GitHub data toolkit, temporary mail, GGUF conversion, user-agent rotation and ASCII art.

The claim on the documentation side is that the public API is fully type-annotated with an auto-generated MkDocs reference, and mkdocs.yml plus a ReadMe config file at the root are consistent with that. Typos and edge-case behaviour aside, the typing claim is the one to hold the project to when you adopt it for something large.

Two licence files, a stray .txt and a live test committed at the root

Maintenance here is fast and slightly untidy, and both are visible in the file list.

Releases are dated rather than numbered: v2026.9.14, v2026.9.20 and v2026.9.25 all shipped within about two weeks, and the last push was on 2026-09-25. A CHANGELOG.md exists at the root, which is where the substance of those releases belongs.

The licensing files need one sentence. LICENSE, LICENSE.md and LEGAL_NOTICE.md all sit at the root, while the packaging metadata declares Apache-2.0 and the README has a note stating that the project is Apache-2.0 licensed and free for personal and commercial use. Consistent, but three files rather than one.

The untidiness is in the leftovers: a file named .txt at the repository root, dark logo.svg next to logo.svg, an SVG whose name is a hash, test_tti_live.py committed outside tests/, and a stray ty.toml. AGENTS.md and CONTRIBUTING.md are the sign that the project expects contributors and agent-assisted changes, and neither is a problem.

None of that affects the package. It does mean that when something breaks after an upgrade, the changelog and the issue tracker are more reliable than the file listing, and that a pinned install is a wiser default than tracking the branch.

Editorial conclusion

Adopt LLM4Free if you want one import path across many free and paid providers, you are willing to check last_provider when quality matters, and you read the API server's defaults before exposing it. Do not deploy the bundled server as it comes: docker-compose.yml sets the host to 0.0.0.0, the port to 8000, and notes in the file itself that authentication is disabled by default and that rate limiting may not be fully supported, so put authentication in front of it or bind it to loopback. Verify three things first: that pip install -U "llm4free[api]" is the extra you actually need, since the server is not in the base package, that your Docker builds pin a version with the LLM4FREE_VERSION build argument, because the image otherwise installs from the git repository, and that Python is within range, since the package requires 3.10 or newer while the classifiers stop at 3.13. The licence is Apache 2.0, and releases v2026.9.14, v2026.9.20 and v2026.9.25 landed inside two weeks.

Frequently asked questions

How do I install LLM4Free and get a working chat call?

Run pip install -U llm4free, then create the unified client with Client(print_provider_info=True) and call client.chat.completions.create with model="auto". Use model="Provider/Model" to force one backend, and read client.chat.completions.last_provider to see which one served the request.

Do I need an API key to use LLM4Free?

No. Providers such as HeckAI and Pollinations work with zero API key, and the package is Apache 2.0 for personal and commercial use. You move to Groq, DeepInfra or your own key when you need scale.

Does the LLM4Free API server need authentication?

By default it does not have any. The compose configuration sets LLM4FREE_HOST to 0.0.0.0 and LLM4FREE_PORT to 8000, and a comment in that file notes that authentication is disabled by default and that rate limiting may not be fully supported, so put authentication in front of it or bind it to loopback.

How do I use LLM4Free web search from Python?

Import a search class such as DuckDuckGoSearch from llm4free, create it, and call text() with your query and max_results. Each result is a dictionary with a title and an href, and the same API covers Bing, Brave, Yahoo, Mojeek and Wikipedia.

Official sources

  1. License: Apache-2.0
  2. OEvortex/llm4free on GitHub
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/oevortex-llm4free.svg)](https://hysenlabs.com/projects/oevortex-llm4free)