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
by xtekky
AI & ML · GPL-3.0 · Python · Updated: 4 months ago
66,028
stars
13,607
Forks
verified
AA
Safety
high
AAA
Quality
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

🔓 Sign in to unlock more
Sign in with GitHub