Search for anything using Google, DuckDuckGo, phind.com, Contains AI models, can transcribe yt videos, temporary email and phone number generation, has TTS support, webai (terminal gpt and open interpreter) and offline LLMs and more
Project description
LLM4Free
Formerly WebScout — Your All-in-One Python Toolkit for Web Search, AI Interaction, Digital Utilities, and More
Access diverse search engines, cutting-edge AI models, temporary communication tools, media utilities, developer helpers, and powerful CLI interfaces -- all through one unified library.
Table of Contents
- Features
- Installation
- Quick Start
- CLI
- AI Chat Providers
- Search Engines
- Text-to-Image
- Text-to-Speech
- OpenAI-Compatible API Server
- Python Client
- Tool Calling
- Model Registry
- Developer Tools
- Documentation
- Contributing
- License
[!IMPORTANT] LLM4Free uses a single unified OpenAI-compatible interface for all providers. Every provider implements
client.chat.completions.create(...)— identical to the OpenAI Python SDK.
[!NOTE] LLM4Free supports 40+ AI providers including: HeckAI, ChatGPT, Groq, DeepInfra, Nvidia, Sambanova, OpenRouter, HuggingFace, OllamaSwarm, and many more.
Features
Search & AI
- Multi-Engine Search -- DuckDuckGo, Bing, Brave, Yahoo, Yep, Yandex, Mojeek, Wikipedia. (Search Docs)
- 40+ AI Providers -- All OpenAI-compatible for easy switching. (Architecture)
- AI-Powered Search -- Perplexity, IAsk, Monica, AyeSoul, WebPilotAI.
- OpenAI-Compatible API Server -- Serve any LLM4Free provider via OpenAI endpoints. (Server Docs)
- Unified Python Client -- Auto-failover chat and image generation. (Client Docs)
Media & Content
- Text-to-Image -- PollinationsAI, Together, Miragic, MagicStudio. (TTI Docs)
- Text-to-Speech -- ElevenLabs, Deepgram, OpenAI FM, Parler, Qwen, MurfAI, and more. (Model Registry)
- Speech-to-Text -- ElevenLabs STT.
- YouTube Toolkit -- Video downloads, transcription, API access. (Docs)
- Weather Tools -- Detailed weather info with ASCII display. (Weather Docs)
Developer Tools
- SwiftCLI -- Elegant CLI framework. (SwiftCLI Docs)
- Scout -- HTML parser and web crawler. (Scout Docs)
- LitPrinter -- Styled console output. (LitPrinter Docs)
- LitAgent -- User-agent rotation and IP toolkit. (LitAgent Docs)
- GitAPI -- GitHub data extraction without auth. (GitAPI Docs)
- GGUF Conversion -- Quantize HuggingFace models to GGUF. (GGUF Docs)
- ZeroArt -- Zero-dependency ASCII art generator. (ZeroArt Docs)
- Utility Decorators --
@timeItand@retryhelpers. (Decorator Docs) - Stream Sanitization -- SSE/HTTP stream processing. (Sanitize Docs)
Privacy & Utilities
- Temp Mail -- Disposable email via Emailnator, MailTM, TempMailIO.
- Proxy Manager -- Automatic proxy rotation. (Architecture)
- Awesome Prompts -- Curated system prompts for AI personas. (Prompts Docs)
Installation
pip (Standard)
pip install -U llm4free
# With API server support
pip install -U "llm4free[api]"
# With development tools
pip install -U "llm4free[dev]"
uv (Recommended)
uv add llm4free
# Run without installing
uv run llm4free --help
# Install as global tool
uv tool install llm4free
Docker
docker pull OEvortex/llm4free:latest
docker run -it OEvortex/llm4free:latest
See docs/DOCKER.md for full Docker deployment options including compose profiles.
Quick Start
AI Chat (No API Key)
from llm4free.Provider.Openai_comp.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)
Web Search
from llm4free import DuckDuckGoSearch
search = DuckDuckGoSearch()
results = search.text("best practices for API design", max_results=5)
for result in results:
print(f"{result['title']}: {result['href']}")
Image Generation
from llm4free.Provider.TTI import PollinationsAI
gen = PollinationsAI()
path = gen.generate_image(prompt="A serene mountain landscape at sunset")
print(f"Saved to: {path}")
See docs/getting-started.md for the full quick-start guide.
Command Line Interface
LLM4Free provides a rich CLI powered by Rich with multi-engine support.
llm4free --help # List all commands
llm4free version # Show version
llm4free text -k "python programming" # DuckDuckGo search (default)
llm4free images -k "mountains" # Image search
llm4free news -k "AI breakthrough" -t w # News from last week
llm4free weather -l "New York" # Weather info
llm4free translate -k "Hola" --to en # Translation
Supported Engines
| Category | Engines |
|---|---|
text |
ddg, bing, brave, yahoo, yep, mojeek, dogpile, wikipedia, yandex |
images |
ddg, bing, brave, yahoo, yep |
videos |
ddg, brave, yahoo |
news |
ddg, bing, brave, yahoo |
suggestions |
ddg, bing, brave, yahoo, yep |
weather |
ddg, yahoo |
answers |
ddg |
translate |
ddg |
maps |
ddg |
# Use a specific engine
llm4free text -k "climate change" -e bing
llm4free text -k "quantum physics" -e wikipedia
Full CLI reference: docs/cli.md
AI Chat Providers
All providers use the OpenAI-compatible interface (client.chat.completions.create(...)).
Free Providers (No Auth Required)
from llm4free.Provider.Openai_comp.heckai import HeckAI
from llm4free.Provider.Openai_comp.artingai import ArtingAI
from llm4free.Provider.Openai_comp.freeai import FreeAI
# HeckAI - multiple models
client = HeckAI()
response = client.chat.completions.create(
model="google/gemini-2.5-flash-preview",
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)
# ArtingAI
client = ArtingAI()
response = client.chat.completions.create(
model="gpt-5",
messages=[{"role": "user", "content": "Hello!"}],
)
Authenticated Providers
from llm4free.Provider.Openai_comp.Auth.groq import Groq
from llm4free.Provider.Openai_comp.Auth.deepinfra import DeepInfra
groq = Groq(api_key="your-key")
response = groq.chat.completions.create(
model="llama-3.3-70b-versatile",
messages=[{"role": "user", "content": "Write a Python function to sort a list"}],
)
print(response.choices[0].message.content)
Streaming
from llm4free.Provider.Openai_comp.heckai import HeckAI
client = HeckAI()
stream = client.chat.completions.create(
model="google/gemini-2.5-flash-preview",
messages=[{"role": "user", "content": "Tell me a joke"}],
stream=True,
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")
See llm4free/llm/ for all available provider implementations.
Search Engines
from llm4free import DuckDuckGoSearch, BingSearch, YepSearch, YahooSearch, BraveSearch
# DuckDuckGo
ddg = DuckDuckGoSearch()
results = ddg.text("python frameworks", max_results=5)
# Bing
bing = BingSearch()
results = bing.text("climate change solutions")
# Brave
brave = BraveSearch()
results = brave.text("machine learning tutorials")
Search docs: docs/search.md
Text-to-Image
from llm4free.Provider.TTI import PollinationsAI, TogetherImage
# PollinationsAI
poll = PollinationsAI()
poll.generate_image(prompt="A cyberpunk city at night")
# Together AI
together = TogetherImage()
together.generate_image(prompt="A robot playing chess")
TTI docs: docs/getting-started.md#image-generation
Text-to-Speech
from llm4free.Provider.TTS import ElevenlabsTTS, ParlerTTS
tts = ElevenlabsTTS()
tts.text_to_speech("Hello, world!", voice="alloy")
TTS model registry: docs/models.md
OpenAI-Compatible API Server
Run a local FastAPI server that serves any LLM4Free provider through standard OpenAI endpoints.
# Start the server
llm4free-server
# Custom config
llm4free-server --port 8080 --host 0.0.0.0 --debug
Use with the OpenAI Python Client
from openai import OpenAI
client = OpenAI(api_key="dummy", base_url="http://localhost:8000/v1")
response = client.chat.completions.create(
model="ChatGPT/gpt-4o",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)
Docker Deployment
docker-compose up llm4free-api
docker-compose -f docker-compose.yml -f docker-compose.no-auth.yml up llm4free-api
Full server docs: docs/openai-api-server.md | Docker: docs/DOCKER.md
Python Client
The unified Client class provides auto-failover across providers with smart model resolution.
from llm4free.client import Client
client = Client(print_provider_info=True)
# Auto provider + model selection
resp = client.chat.completions.create(
model="auto",
messages=[{"role": "user", "content": "Summarize LLM4Free."}]
)
print(resp.choices[0].message.content)
# Streaming
stream = client.chat.completions.create(
model="ChatGPT/gpt-4o-mini",
messages=[{"role": "user", "content": "Write a limerick about Python."}],
stream=True,
)
for chunk in stream:
delta = chunk.choices[0].delta.content
if delta:
print(delta, end="", flush=True)
# Image generation
img = client.images.generate(prompt="A neon owl", model="auto", size="1024x1024")
print(img.data[0].url)
Client docs: docs/client.md
Tool Calling
LLM4Free has a built-in tool calling system that works with any provider.
from llm4free.Provider.Openai_comp.heckai import HeckAI
from llm4free.Provider.Openai_comp.base import Tool
def get_weather(city: str) -> str:
return f"Weather in {city}: Sunny, 25C"
weather_tool = Tool(
name="get_weather",
description="Get current weather for a city.",
parameters={"city": {"type": "string", "description": "City name."}},
implementation=get_weather,
)
client = HeckAI(tools=[weather_tool])
response = client.chat.completions.create(
model="google/gemini-2.5-flash-preview",
messages=[{"role": "user", "content": "What is the weather in London?"}],
)
print(response.choices[0].message.content)
Tool calling docs: docs/tool-calling.md
Model Registry
Enumerate available models across all providers.
from llm4free import model
# All LLM models
all_models = model.llm.list()
print(f"Total: {len(all_models)}")
# Models by provider
summary = model.llm.summary()
for provider, count in summary.items():
print(f" {provider}: {count}")
# TTS voices
voices = model.tts.list()
print(f"Total voices: {len(voices)}")
Model registry docs: docs/models.md
Developer Tools
| Tool | Description | Docs |
|---|---|---|
| SwiftCLI | CLI framework with decorators | docs/swiftcli.md |
| Scout | HTML parser & web crawler | docs/scout.md |
| LitPrinter | Styled debug printing | docs/litprinter.md |
| LitAgent | User-agent rotation | docs/litagent.md |
| GitAPI | GitHub data extraction | docs/gitapi.md |
| GGUF | Model conversion & quantization | docs/gguf.md |
| ZeroArt | ASCII art generator | docs/zeroart.md |
| Weather | Weather toolkit | docs/weather.md |
| Decorators | @timeIt and @retry |
docs/decorators.md |
| Sanitize | Stream sanitization | docs/sanitize.md |
| Prompts | System prompt manager | docs/awesome-prompts.md |
Documentation
| Resource | Description |
|---|---|
| Getting Started | Installation, first chat, web search, image generation |
| Architecture | System design, layers, and data flows |
| CLI Reference | All CLI commands and options |
| Python Client | Unified client with auto-failover |
| API Server | OpenAI-compatible FastAPI server |
| Model Registry | Enumerate LLM, TTS, TTI models |
| Tool Calling | Function calling with any provider |
| Search Docs | Multi-engine search API |
| Scout | HTML parser and crawler |
| Provider Development | Create custom providers |
| Deployment | Production deployment guide |
| Docker | Docker setup and compose profiles |
| Inferno | Local LLM server |
| Troubleshooting | Common issues and solutions |
| Contributing | How to contribute |
| Provider Modules | All provider implementations |
| Docs Hub | Full documentation index |
Contributing
See docs/contributing.md for guidelines.
- Fork the repository
- Create a feature branch
- Make changes with descriptive commits
- Submit a pull request
License
Apache-2.0. See LICENSE.md.
Made with by the LLM4Free team
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llm4free-2026.6.12.tar.gz.
File metadata
- Download URL: llm4free-2026.6.12.tar.gz
- Upload date:
- Size: 479.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Zorin OS","version":"18","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
935ffb13f5be7ba6bedf28de5afc843a495d6e4f3b21f1ce7eef1e9b5266fbe9
|
|
| MD5 |
075b6db332f51052492db4ae1490e44c
|
|
| BLAKE2b-256 |
80ddb9b55a1473089acdeef32827294a98587d6b9428b5596a9136ff23400dfd
|
File details
Details for the file llm4free-2026.6.12-py3-none-any.whl.
File metadata
- Download URL: llm4free-2026.6.12-py3-none-any.whl
- Upload date:
- Size: 612.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Zorin OS","version":"18","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f95a8cf4e3006b5273862d32914e8d7ce7c48aa6a7804caf3a092b880b1c10e7
|
|
| MD5 |
b5417bbad9aaf4cef1e3036b8c980f40
|
|
| BLAKE2b-256 |
bd1335df8adbd2c6baf45ced2f9278049700dcb2cb4a1c7a37cad7b6742a0ef1
|