Gpt4free

The official gpt4free repository | various collection of powerful language models | opus 4.6 gpt 5.3 kimi 2.5 deepseek v3.2 gemini 3

xtekky
作者 xtekky
AI 与机器学习 · GPL-3.0 · Python · 更新时间: 4 months ago
66,028
星标
13,607
Forks
已验证
AA
安全:
优秀
AAA
质量:
chatbotchatbotschatgptchatgpt-4chatgpt-apichatgpt-freechatgpt4deepseekdeepseek-apideepseek-r1gptgpt-4gpt-4ogpt4gpt4-apilanguage-modelopenaiopenai-apiopenai-chatgptreverse-engineering

SKILL.md

Using gpt4free as an LLM Server for Bots (Clawbot/OpenClaw)

Overview

This skill covers running gpt4free as a local LLM server with an OpenAI-compatible REST API, custom model routing (config.yaml), and integration with bots like Clawbot or OpenClaw.

Best Practices

Common Pitfalls

Workflow Steps

  1. Install and set up gpt4free (see README)
  2. Start the API server: python -m g4f --port 8080
  3. (Optional) Create or edit config.yaml for custom model routing:
    models:
        - name: "openclaw"
            providers:
                - provider: "GeminiCLI"
                    model: "gemini-3-flash-preview"
                    condition: "quota.models.gemini-3-flash-preview.remainingFraction > 0 and error_count < 3"
                - provider: "Antigravity"
                    model: "gemini-3-flash"
                - provider: "PollinationsAI"
                    model: "openai"
    
  4. Patch your bot config (e.g., OpenClaw) to use http://localhost:8080/v1 as the base URL (see scripts/patch-openclaw.py)
  5. Start your bot and verify it connects to gpt4free
  6. Monitor logs and test with the Python client or CLI

References

🔓 登录解锁更多
使用 GitHub 登录