Releases: xtekky/gpt4free
Release v6.6.2
Release Notes πβ¨
Thanks to everyone who contributed! Special shoutouts to @3mora2 and @hlohaus for recent fixes and refactors. Below are the highlights for v6.6.2.
Highlights π
-
Improved Copilot auth/cookie handling π‘οΈ
- Better detection of Copilot anonymous/auth cookies during token retrieval to make login/anonymous flows more reliable.
-
LMArena provider fixes & stabilization π§
- Fixed multiple LMArena flow bugs (session/evaluation handling, streaming parsing and event handling).
- Improved UUIDv7 generation used by LMArena to better match expected browser semantics.
- More robust handling of model selection and POST/stream endpoints.
-
PollinationsAI refactor & model-selection improvements π¨
- Refactored model-selection logic and default system behavior.
- More accurate audio/media detection and automatic switching to audio-capable model when necessary.
-
Cloudflare provider adjustments βοΈ
- Marked Cloudflare AI provider as not working by default in this release (working flag set to False).
- Other internal adjustments to endpoint configuration and nodriver usage.
-
OpenAI HAR handling updates π΅οΈββοΈ
- Changes to har_file handling (crypt import handling, StreamSession usage, cookie directory logic) improving robustness when importing HAR files.
-
Integration with pydantic_ai rework π§©
- Major overhaul of the pydantic_ai integration: new AIModel class now uses chat-model class, response processing, usage parsing, and patched infer_model.
- This is a substantial internal change β see Migration Notes below.
-
Cleanup & deletions π§Ή
- Removed older uuid integration file and other cleanup across integrations/providers.
- Large number of deletions/cleanup for modernization and simplification (internal reorg).
Bugfixes π
- Fixed LMArena streaming parsing (line prefixes, JSON handling) to reduce false errors and improve finalization events.
- Fixes to Copilot token/cookie loops to avoid waiting forever when cookies are already present.
- PollinationsAI: ensure audio model is selected when attachments contain audio and fix several model aliasing issues.
- Miscellaneous provider improvements, small bugfixes and stability fixes across several providers.
Developer notes / Breaking changes
- pydantic_ai integration changed significantly β if you rely on the old behavior/patching, please review the new AIModel and infer_model patching. You may need to update any custom integrations that assumed the previous classes/names.
- Some internal files were removed or renamed (for example: integration/uuid.py was deleted). If you depended on these, please adapt to the new utilities.
- Cloudflare provider marked as not working by default β you may need to enable or patch if you still want to use it.
Performance & internal refactor π§
- Several providers were refactored for consistency (stream handling, JsonRequest yields, StreamSession usage).
- Reduced duplicated logic and cleaned many modules for maintainability.
Contributors π
- @3mora2 β auth/cookie improvements, tests/fixes
- @hlohaus β LMArena fixes, PollinationsAI refactor, general cleanups
- Other contributors across the repo β thank you!
How to upgrade πΌ
- Standard pip/installation steps (or pull latest repository). Review CHANGELOG and run tests for providers you rely on, especially if you integrate pydantic_ai or use LMArena/PollinationsAI/Cloudflare providers.
Contact / Help π¬
- If you encounter regressions, please open an issue with logs and repro steps. Include provider name, used model, and any HAR/session data if relevant.
Enjoy v6.6.2 β cleaner internals, more robust providers, and fewer surprises! ππ§β¨
Full Changelog: v6.5.7...v6.6.2
g4f v6.6.2
Download Options
Python Package:
- PyPI:
pip install g4f==v6.6.2
Executables:
- Windows x64:
g4f-windows-v6.6.2-x64.zip - Linux x64:
g4f-linux-v6.6.2-x64 - Linux ARM64:
g4f-linux-v6.6.2-arm64 - macOS x64:
g4f-macos-v6.6.2-x64 - macOS ARM64:
g4f-macos-v6.6.2-arm64
System Packages:
- WinGet:
winget install gpt4free
Docker:
docker pull hlohaus789/g4f:v6.6.2docker pull hlohaus789/g4f:v6.6.2-slim
π» Having trouble with the .exe from this release?
π Check out the Windows launcher for GPT4Free instead:
π https://github.com/gpt4free/g4f.exe π
Release v6.6.1
Release Notes πβ¨
Thanks to everyone who contributed! Special shoutouts to @3mora2 and @hlohaus for recent fixes and refactors. Below are the highlights for v6.6.0.
Highlights π
-
Improved Copilot auth/cookie handling π‘οΈ
- Better detection of Copilot anonymous/auth cookies during token retrieval to make login/anonymous flows more reliable.
-
LMArena provider fixes & stabilization π§
- Fixed multiple LMArena flow bugs (session/evaluation handling, streaming parsing and event handling).
- Improved UUIDv7 generation used by LMArena to better match expected browser semantics.
- More robust handling of model selection and POST/stream endpoints.
-
PollinationsAI refactor & model-selection improvements π¨
- Refactored model-selection logic and default system behavior.
- More accurate audio/media detection and automatic switching to audio-capable model when necessary.
-
Cloudflare provider adjustments βοΈ
- Marked Cloudflare AI provider as not working by default in this release (working flag set to False).
- Other internal adjustments to endpoint configuration and nodriver usage.
-
OpenAI HAR handling updates π΅οΈββοΈ
- Changes to har_file handling (crypt import handling, StreamSession usage, cookie directory logic) improving robustness when importing HAR files.
-
Integration with pydantic_ai rework π§©
- Major overhaul of the pydantic_ai integration: new AIModel class now uses chat-model class, response processing, usage parsing, and patched infer_model.
- This is a substantial internal change β see Migration Notes below.
-
Cleanup & deletions π§Ή
- Removed older uuid integration file and other cleanup across integrations/providers.
- Large number of deletions/cleanup for modernization and simplification (internal reorg).
Bugfixes π
- Fixed LMArena streaming parsing (line prefixes, JSON handling) to reduce false errors and improve finalization events.
- Fixes to Copilot token/cookie loops to avoid waiting forever when cookies are already present.
- PollinationsAI: ensure audio model is selected when attachments contain audio and fix several model aliasing issues.
- Miscellaneous provider improvements, small bugfixes and stability fixes across several providers.
Developer notes / Breaking changes
- pydantic_ai integration changed significantly β if you rely on the old behavior/patching, please review the new AIModel and infer_model patching. You may need to update any custom integrations that assumed the previous classes/names.
- Some internal files were removed or renamed (for example: integration/uuid.py was deleted). If you depended on these, please adapt to the new utilities.
- Cloudflare provider marked as not working by default β you may need to enable or patch if you still want to use it.
Performance & internal refactor π§
- Several providers were refactored for consistency (stream handling, JsonRequest yields, StreamSession usage).
- Reduced duplicated logic and cleaned many modules for maintainability.
Contributors π
- @3mora2 β auth/cookie improvements, tests/fixes
- @hlohaus β LMArena fixes, PollinationsAI refactor, general cleanups
- Other contributors across the repo β thank you!
How to upgrade πΌ
- Standard pip/installation steps (or pull latest repository). Review CHANGELOG and run tests for providers you rely on, especially if you integrate pydantic_ai or use LMArena/PollinationsAI/Cloudflare providers.
Contact / Help π¬
- If you encounter regressions, please open an issue with logs and repro steps. Include provider name, used model, and any HAR/session data if relevant.
Enjoy v6.6.0 β cleaner internals, more robust providers, and fewer surprises! ππ§β¨
Full Changelog: v6.5.7...v6.6.1
g4f v6.6.1
Download Options
Python Package:
- PyPI:
pip install g4f==v6.6.1
Executables:
- Windows x64:
g4f-windows-v6.6.1-x64.zip - Linux x64:
g4f-linux-v6.6.1-x64 - Linux ARM64:
g4f-linux-v6.6.1-arm64 - macOS x64:
g4f-macos-v6.6.1-x64 - macOS ARM64:
g4f-macos-v6.6.1-arm64
System Packages:
- WinGet:
winget install gpt4free
Docker:
docker pull hlohaus789/g4f:v6.6.1docker pull hlohaus789/g4f:v6.6.1-slim
π» Having trouble with the .exe from this release?
π Check out the Windows launcher for GPT4Free instead:
π https://github.com/gpt4free/g4f.exe π
Release v6.5.7
Full Changelog: v6.5.6...v6.5.7
g4f v6.5.7
Download Options
Python Package:
- PyPI:
pip install g4f==v6.5.7
Executables:
- Windows x64:
g4f-windows-v6.5.7-x64.zip - Linux x64:
g4f-linux-v6.5.7-x64 - Linux ARM64:
g4f-linux-v6.5.7-arm64 - macOS x64:
g4f-macos-v6.5.7-x64 - macOS ARM64:
g4f-macos-v6.5.7-arm64
System Packages:
- WinGet:
winget install gpt4free
Docker:
docker pull hlohaus789/g4f:v6.5.7docker pull hlohaus789/g4f:v6.5.7-slim
π» Having trouble with the .exe from this release?
π Check out the Windows launcher for GPT4Free instead:
π https://github.com/gpt4free/g4f.exe π
Release v6.5.6
Full Changelog: v6.5.5...v6.5.6
g4f v6.5.6
Download Options
Python Package:
- PyPI:
pip install g4f==v6.5.6
Executables:
- Windows x64:
g4f-windows-v6.5.6-x64.zip - Linux x64:
g4f-linux-v6.5.6-x64 - Linux ARM64:
g4f-linux-v6.5.6-arm64 - macOS x64:
g4f-macos-v6.5.6-x64 - macOS ARM64:
g4f-macos-v6.5.6-arm64
System Packages:
- WinGet:
winget install gpt4free
Docker:
docker pull hlohaus789/g4f:v6.5.6docker pull hlohaus789/g4f:v6.5.6-slim
π» Having trouble with the .exe from this release?
π Check out the Windows launcher for GPT4Free instead:
π https://github.com/gpt4free/g4f.exe π
Release v6.5.5
We're excited to announce gpt4free v6.5.5 with our brand-new Model Context Protocol (MCP) server implementation! This release brings powerful tool integration capabilities to your AI workflows.
β¨ Key Features
1. π MCP Server Implementation
- Integrated web search using DuckDuckGo
- Web scraping capabilities with content extraction
- Image generation via multiple AI providers
- Supports stdio and HTTP transports (with CORS support)
2. π οΈ New Command Line Interface
# Start MCP server in stdio mode (default)
g4f mcp
# Start in HTTP mode (port 8765)
g4f mcp --http --port 87653. π Seamless AI Assistant Integration
// Sample Claude Desktop Configuration
{
"mcpServers": {
"gpt4free": {
"command": "python",
"args": ["-m", "g4f.mcp"]
}
}
}4. π§° Available Tools
| Tool | Description | Required Parameters |
|---|---|---|
web_search |
Web search with DuckDuckGo | query |
web_scrape |
Web page content extraction | url |
image_generation |
AI image creation | prompt |
5. π Comprehensive Documentation
- Added
/docs/mcp-usage-guide.md - Interactive demo scripts (
etc/examples/mcp_tools_demo.py) - Unit tests covering 100% of MCP functionality
π Installation & Upgrade
# New installation
pip install g4f
# Upgrade existing installation
pip install g4f --upgradeπ§© Technical Enhancements
- Dependencies:
aiohttpfor async HTTP handlingbeautifulsoup4for web scrapingddgsfor search functionality
- GUI Integration:
- MCP server management interface
- Tool selection panel in chat UI
- HTTP Endpoints:
POST /mcp- JSON-RPC 2.0 endpointGET /health- Health check endpoint
π Notable Fixes
- Improved JSON-RPC error handling (-32601 to -32603 codes)
- Fixed web scraping content truncation
- Enhanced image generation validation
- CLI argument parsing improvements
π Sample Usage
Web Search Example:
from g4f.mcp import MCPServer, WebSearchTool
async def demo_search():
tool = WebSearchTool()
result = await tool.execute({"query": "Python tutorials", "max_results": 3})
print(json.dumps(result, indent=2))HTTP Mode Quickstart:
Start server:
g4f mcp --http --host 0.0.0.0 --port 3000
Test with curl:
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'π Full Changelog
- Added 15+ new MCP-related modules
- Implemented 98 file changes (+2,869 LOC)
- Created comprehensive test suite (87% coverage)
- Updated CLI with MCP commands
- Added CORS support for web integrations
- Enhanced documentation with usage examples
- Fixed various stability issues
π Contributors
Special thanks to @hlohaus and the gpt4free team for their outstanding work on this release!
Upgrade now to unleash the full potential of AI tool integration with gpt4free's MCP server! π
g4f v6.5.5
Download Options
Python Package:
- PyPI:
pip install g4f==v6.5.5
Executables:
- Windows x64:
g4f-windows-v6.5.5-x64.zip - Linux x64:
g4f-linux-v6.5.5-x64 - Linux ARM64:
g4f-linux-v6.5.5-arm64 - macOS x64:
g4f-macos-v6.5.5-x64 - macOS ARM64:
g4f-macos-v6.5.5-arm64
System Packages:
- WinGet:
winget install gpt4free
Docker:
docker pull hlohaus789/g4f:v6.5.5docker pull hlohaus789/g4f:v6.5.5-slim
π» Having trouble with the .exe from this release?
π Check out the Windows launcher for GPT4Free instead:
π https://github.com/gpt4free/g4f.exe π
Release v6.5.4
π gpt4free v6.5.4 Release Notes
Welcome to gpt4free v6.5.4! This update brings enhanced stability, richer response handling, and streamlined media processing. We've refactored key providers for better error resilience and added support for advanced response types in Perplexity. A total of 3 commits and 9 files changed by hlohaus β let's dive in! π
β¨ New Features & Enhancements
-
π§ Refactored Copilot Provider: Improved error handling in WebSocket connections with smarter timeouts (reduced to 1s when done) and better turnstile detection for authentication. This makes Copilot more reliable under flaky networks. π‘
-
π Enhanced Perplexity Provider: Now yields richer response types including:
- Sources for web results πΈοΈ
- Media Previews with image dimensions and YouTube embeds π₯
- Suggested Followups for seamless conversation flow π¬
Perplexity just got more powerful for research and multimedia queries!
-
πΌοΈ Streamlined Media Handling in MarkItDown & OpenaiChat:
- Simplified MarkItDown audio processing: Better URL handling for remote files and reduced dependency on external LLM clients. Faster conversions! β‘
- OpenaiChat now supports temporary conversations, improved media prompts, and JSON request/response serialization. Added web search flags and better auth flows. π
-
πΈ Simplified PollinationsAI: Removed complex follow-up tools and developer messages for cleaner text/image generation. Fixed error logging and async image fetching for more robust outputs. Images load smoother now! πΌοΈ
π Bug Fixes & Refinements
-
API Improvements: Added rate limiting detection (HTTP 429) and "most wanted" IP tracking in the demo mode to prevent abuse. Better error responses for unauthorized requests. π«
-
Image Utils: Fixed media detection for HTTP URLs and data URIs β no more false positives on binary streams. πΈ
-
Response Formatting: Enhanced link rendering in sources (better title fallbacks) and image markdown (improved thumbnails with width/height attrs). Cleaner output every time! π
-
Minor Cleanups: Removed debug prints from YouTube converter and unused params in auth flows. Code is leaner and meaner. π¨
π Stats at a Glance
- Total Changes: +73 lines added, -105 lines removed (net: -32) β efficiency boost! βοΈ
- Files Touched: 9 (Providers: Copilot, Perplexity, PollinationsAI, MarkItDown, OpenaiChat; plus API, image utils, and response types)
- Commit Date: October 31, 2025 (spooky improvements just in time! π»)
π Getting Started
Upgrade via pip: pip install -U g4f
Test the new Perplexity enhancements:
import g4f
response = g4f.ChatCompletion.create(
model="gpt-4",
provider=g4f.Provider.Perplexity,
messages=[{"role": "user", "content": "Latest AI news?"}]
)
# Expect sources, images, and followups!π€ Thanks & Contributing
Shoutout to @hlohaus for the stellar commits! If you spot issues or want to contribute, check out our GitHub repo. Star us β and join the discussions!
Stay free, stay smart! ππ§
β The gpt4free Team
Download Options
Python Package:
- PyPI:
pip install g4f==v6.5.4
Executables:
- Windows x64:
g4f-windows-v6.5.4-x64.zip - Linux x64:
g4f-linux-v6.5.4-x64 - Linux ARM64:
g4f-linux-v6.5.4-arm64 - macOS x64:
g4f-macos-v6.5.4-x64 - macOS ARM64:
g4f-macos-v6.5.4-arm64
System Packages:
- WinGet:
winget install gpt4free
Docker:
docker pull hlohaus789/g4f:v6.5.4docker pull hlohaus789/g4f:v6.5.4-slim
π» Having trouble with the .exe from this release?
π Check out the Windows launcher for GPT4Free instead:
π https://github.com/gpt4free/g4f.exe π
Release v6.5.3
Full Changelog: v6.5.2...v6.5.3
g4f v6.5.3
Download Options
Python Package:
- PyPI:
pip install g4f==v6.5.3
Executables:
- Windows x64:
g4f-windows-v6.5.3-x64.zip - Linux x64:
g4f-linux-v6.5.3-x64 - Linux ARM64:
g4f-linux-v6.5.3-arm64 - macOS x64:
g4f-macos-v6.5.3-x64 - macOS ARM64:
g4f-macos-v6.5.3-arm64
System Packages:
- WinGet:
winget install gpt4free
Docker:
docker pull hlohaus789/g4f:v6.5.3docker pull hlohaus789/g4f:v6.5.3-slim
π» Having trouble with the .exe from this release?
π Check out the Windows launcher for GPT4Free instead:
π https://github.com/gpt4free/g4f.exe π
Release v6.5.2
Full Changelog: v6.5.1...v6.5.2
g4f v6.5.2
Download Options
Python Package:
- PyPI:
pip install g4f==v6.5.2
Executables:
- Windows x64:
g4f-windows-v6.5.2-x64.zip - Linux x64:
g4f-linux-v6.5.2-x64 - Linux ARM64:
g4f-linux-v6.5.2-arm64 - macOS x64:
g4f-macos-v6.5.2-x64 - macOS ARM64:
g4f-macos-v6.5.2-arm64
System Packages:
- WinGet:
winget install gpt4free
Docker:
docker pull hlohaus789/g4f:v6.5.2docker pull hlohaus789/g4f:v6.5.2-slim
π» Having trouble with the .exe from this release?
π Check out the Windows launcher for GPT4Free instead:
π https://github.com/gpt4free/g4f.exe π
Release v6.5.1
Full Changelog: v6.5.0...v6.5.1
g4f v6.5.1
Download Options
Python Package:
- PyPI:
pip install g4f==v6.5.1
Executables:
- Windows x64:
g4f-windows-v6.5.1-x64.zip - Linux x64:
g4f-linux-v6.5.1-x64 - Linux ARM64:
g4f-linux-v6.5.1-arm64 - macOS x64:
g4f-macos-v6.5.1-x64 - macOS ARM64:
g4f-macos-v6.5.1-arm64
System Packages:
- WinGet:
winget install gpt4free
Docker:
docker pull hlohaus789/g4f:v6.5.1docker pull hlohaus789/g4f:v6.5.1-slim
π» Having trouble with the .exe from this release?
π Check out the Windows launcher for GPT4Free instead:
π https://github.com/gpt4free/g4f.exe π