AI Skill Hub 推荐使用:gpt4free AI技能包 是一款优质的AI工具。在 GitHub 上收获超过 66.2k 颗 Star,AI 综合评分 7.8 分,在同类工具中表现稳健。如果你正在寻找可靠的AI工具解决方案,这是一个值得深入了解的选择。
聚合多个强大语言模型的开源项目,提供免费的ChatGPT、GPT-4等AI接口调用方案。支持Python集成,适合开发者、研究人员和成本敏感型企业构建AI应用和chatbot。
gpt4free AI技能包 是一款基于 Python 开发的开源工具,专注于 语言模型、ChatGPT、开源 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
聚合多个强大语言模型的开源项目,提供免费的ChatGPT、GPT-4等AI接口调用方案。支持Python集成,适合开发者、研究人员和成本敏感型企业构建AI应用和chatbot。
gpt4free AI技能包 是一款基于 Python 开发的开源工具,专注于 语言模型、ChatGPT、开源 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 方式一:pip 安装(推荐)
pip install gpt4free
# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install gpt4free
# 方式三:从源码安装(获取最新功能)
git clone https://github.com/xtekky/gpt4free
cd gpt4free
pip install -e .
# 验证安装
python -c "import gpt4free; print('安装成功')"
# 命令行使用
gpt4free --help
# 基本用法
gpt4free input_file -o output_file
# Python 代码中调用
import gpt4free
# 示例
result = gpt4free.process("input")
print(result)
# gpt4free 配置文件示例(config.yml) app: name: "gpt4free" debug: false log_level: "INFO" # 运行时指定配置文件 gpt4free --config config.yml # 或通过环境变量配置 export GPT4FREE_API_KEY="your-key" export GPT4FREE_OUTPUT_DIR="./output"
<p align="center"> <img src="https://g4f.dev/docs/images/477107515-7f60c240-00fa-4c37-bf7f-ae5cc20906a1.png" alt="GPT4Free logo" height="200" /> </p>
<p align="center"> <span style="background: linear-gradient(45deg, #12c2e9, #c471ed, #f64f59); -webkit-background-clip: text; -webkit-text-fill-color: transparent;"> <strong>Created by <a href="https://github.com/xtekky">@xtekky</a>,<br> maintained by <a href="https://github.com/hlohaus">@hlohaus</a></strong> </span> </p> <p align="center"> <span>Support the project on</span> <a href="https://github.com/sponsors/hlohaus" target="_blank" rel="noopener noreferrer"> GitHub Sponsors </a> ❤️ </p> <p align="center"> Live demo & docs: https://g4f.dev | Documentation: https://g4f.dev/docs </p>
---
GPT4Free (g4f) is a community-driven project that aggregates multiple accessible providers and interfaces to make working with modern LLMs and media-generation models easier and more flexible. GPT4Free aims to offer multi-provider support, local GUI, OpenAI-compatible REST APIs, and convenient Python and JavaScript clients — all under a community-first license.
This README is a consolidated, improved, and complete guide to installing, running, and contributing to GPT4Free.
Table of contents - What’s included - Quick links - Requirements & compatibility - Installation - Docker (recommended) - Slim Docker image - Windows (.exe) - Python (pip / from source / partial installs) - Running the app - GUI (web client) - FastAPI / Interference API - CLI - Optional provider login (desktop in container) - Using the Python client - Synchronous text example - Image generation example - Async client example - Using GPT4Free.js (browser JS client) - Providers & models (overview) - Local inference & media - Configuration & customization - Running on smartphone - Interference API (OpenAI‑compatible) - Examples & common patterns - Contributing - How to create a new provider - How AI can help you write code - Security, privacy & takedown policy - Credits, contributors & attribution - Powered-by highlights - Changelog & releases - Manifesto / Project principles - License - Contact & sponsorship - Appendix: Quick commands & examples
---
Provider requirements may include: - API keys or tokens (for authenticated providers) - Browser cookies / HAR files for providers scraped via browser automation - Chrome/Chromium or headless browser tooling - Local model binaries and runtime (for local inference)
---
---
---
1. Install Docker: https://docs.docker.com/get-docker/ 2. Create persistent directories: - Example (Linux/macOS):
mkdir -p ${PWD}/har_and_cookies ${PWD}/generated_media
sudo chown -R 1200:1201 ${PWD}/har_and_cookies ${PWD}/generated_media
3. Pull image: docker pull hlohaus789/g4f
4. Run container: docker run -p 8080:8080 -p 7900:7900 \
--shm-size="2g" \
-v ${PWD}/har_and_cookies:/app/har_and_cookies \
-v ${PWD}/generated_media:/app/generated_media \
hlohaus789/g4f:latest
Notes: - Port 8080 serves GUI/API; 7900 can expose a VNC-like desktop for provider logins (optional). - Increase --shm-size for heavier browser automation tasks.
mkdir -p ${PWD}/har_and_cookies ${PWD}/generated_media
chown -R 1000:1000 ${PWD}/har_and_cookies ${PWD}/generated_media
docker run \
-p 1337:8080 -p 8080:8080 \
-v ${PWD}/har_and_cookies:/app/har_and_cookies \
-v ${PWD}/generated_media:/app/generated_media \
hlohaus789/g4f:latest-slim Notes: - The slim image can update the g4f package on startup and installs additional dependencies as needed. - In this example, the Interference API is mapped to 1337.
Prerequisites: - Python 3.10+ (https://www.python.org/downloads/) - Chrome/Chromium for some providers.
Install from PyPI (recommended):
pip install -U g4f[all]
Partial installs - To install only specific functionality, use optional extras groups. See docs/requirements.md in the project docs.
Install from source:
git clone https://github.com/xtekky/gpt4free.git
cd gpt4free
pip install -r requirements.txt
pip install -e .
Notes: - Some features require Chrome/Chromium or other tools; follow provider-specific docs.
---
👉 Check out the Windows launcher for GPT4Free: 🔗 https://github.com/gpt4free/g4f.exe 🚀
1. Download the release artifact g4f.exe.zip from: https://github.com/xtekky/gpt4free/releases/latest 2. Unzip and run g4f.exe. 3. Open GUI at: http://localhost:8080/chat/ 4. If Windows Firewall blocks access, allow the application.
---
Install (pip):
pip install -U g4f[all]
Run GUI (Python): ```bash python -m g4f.cli gui --port 8080 --debug
- Accessible at:
http://localhost:7900/?autoconnect=1&resize=scale&password=secret
- Useful for logging into web-based providers to obtain cookies/HAR files.
---
---
- Start FastAPI server:
python -m g4f --port 8080 --debug - If using slim docker mapping, Interference API may be available at http://localhost:1337/v1 - Swagger UI: http://localhost:1337/docs
http://localhost:1337/v1http://localhost:1337/docs---
python -m g4f.mcp
**Starting the MCP server (HTTP mode):**bash
高星热门开源项目,创意性强,降低AI开发门槛。但因依赖第三方接口存在法律和稳定性风险,需谨慎评估使用场景。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
⚠️ GPL 3.0 — 强 Copyleft,衍生作品须开源,含专利保护条款,不可闭源使用。
总体来看,gpt4free AI技能包 是一款质量良好的AI工具,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。
| 原始名称 | gpt4free |
| 原始描述 | 开源AI工具:The official gpt4free repository | various collection of powerful language model。⭐66.2k · Python |
| Topics | 语言模型ChatGPT开源API多模型聚合 |
| GitHub | https://github.com/xtekky/gpt4free |
| License | GPL-3.0 |
| 语言 | Python |
收录时间:2026-05-14 · 更新时间:2026-05-22 · License:GPL-3.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。