selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

Qwen Gate logo

Self-host Qwen Gate

v0.8.0

OpenAI-compatible API gateway for free Qwen models

BetaOpen SourceMIT
Updated2 months ago
LanguageTypescript
Setup difficultyModerate
ThemeDark mode
Stars
206
Port
26405 (HTTP API server)
Requires
Bun runtime, Chromium/Firefox/WebKit (Playwright), Qwen accounts (chat.qwen.ai)
Install with Windows

What is Qwen Gate?

Qwen Gate is a self-hosted API gateway that provides OpenAI-compatible access to Qwen large language models hosted on chat.qwen.ai. It uses browser automation to authenticate with Qwen accounts and then routes API requests through a browserless fetch layer. The gateway supports streaming SSE responses, OpenAI-style function calling parsed from model output, multi-account round-robin rotation with automatic failover, session pooling for efficiency, and a web dashboard for monitoring and account management. It runs on Bun with TypeScript, requires no build step, and can be installed via Docker, a one-command shell script, or manually on Linux, macOS, and Windows. The project is MIT-licensed and intended for educational use; users must follow chat.qwen.ai's terms of service.

Should you self-host Qwen Gate?

Qwen Gate scores 46/100 on selfhost.directory (how scoring works) and ranks #70 of 125 in AI. It has 206 GitHub stars.

It shipped 10 stable releases in the past year. The latest, v0.8.0, came out on 25 June 2026. New versions land roughly every 2 days.

Setup is moderate: expect some configuration beyond a single command. It is MIT-licensed and written mostly in Typescript.

Its closest alternative on selfhost.directory is Text Generation WebUI (76/100, 47 726 stars). It scores higher overall, so compare the two before you pick. See Qwen Gate vs Text Generation WebUI side by side.

Features

  • Cluster mode
  • Content filter pipeline
  • File upload for large context
  • Multi-account rotation3+ accounts recommended
  • No Build Step
  • OpenAI Compatible API
  • Session pooling
  • Streaming (SSE)
  • Tool CallingQwen doesn't natively support tool calling; gateway parses JSON text from model output
  • Web Dashboard

Qwen Gate README

How to install Qwen Gate

Install Qwen Gate with Windows

Windows with PowerShell

powershell -ExecutionPolicy Bypass -c "curl.exe -sSL https://raw.githubusercontent.com/youssefvdel/qwen-gate/main/install.ps1 | iex" cd qwen-gate qg

PowerShell installer for Windows

How to configure Qwen Gate

  • API_KEYBearer token for API auth (empty = no auth)

    Bearer token for API auth (empty = no auth)

  • AUTH_REFRESH_BEFORE_MS300000Auth token refresh before expiry in milliseconds

    Auth token refresh before expiry in milliseconds

  • AUTH_TOKEN_MAX_AGE_MS28800000Auth token max age in milliseconds

    Auth token max age in milliseconds

  • CLAUDE_CODE_PROXYfalseEnable Claude Code proxy

    Enable Claude Code proxy

    values: true, false

  • CLEAN_OUTPUTtrueStrip internal artifacts from responses

    Strip internal artifacts from responses

    values: true, false

  • CUSTOM_INSTRUCTIONCustom system instruction

    Custom system instruction

  • DARK_MODEfalseEnable dark mode in dashboard

    Enable dark mode in dashboard

    values: true, false

  • DELETE_SESSIONtrueDelete session on cleanup

    Delete session on cleanup

    values: true, false

  • HOSTBind address

    Bind address

  • MAX_LOGS50Maximum logs to keep in memory

    Maximum logs to keep in memory

  • MAX_TOOL_CALLS_PER_RESPONSE3Maximum tool calls per response

    Maximum tool calls per response

  • MODELS_CACHE_TTL_MS3600000Models cache TTL in milliseconds

    Models cache TTL in milliseconds

  • OPEN_DASHBOARD_ON_STARTfalseAuto-open dashboard in browser on start

    Auto-open dashboard in browser on start

    values: true, false

  • PORT26405Server port

    Server port

  • QWEN_FETCH_TIMEOUT_MS30000Qwen fetch timeout in milliseconds

    Qwen fetch timeout in milliseconds

  • RATE_LIMIT_COOLDOWN_MS120000Cooldown after rate limit in milliseconds

    Cooldown after rate limit in milliseconds

  • RETRY_BACKOFF_MULTIPLIER2Retry backoff multiplier

    Retry backoff multiplier

  • RETRY_BASE_DELAY_MS1000Base retry delay in milliseconds

    Base retry delay in milliseconds

  • RETRY_ENABLEDtrueEnable retries

    Enable retries

    values: true, false

  • RETRY_MAX_ATTEMPTS3Max retry attempts

    Max retry attempts

  • RETRY_MAX_DELAY_MS30000Max retry delay in milliseconds

    Max retry delay in milliseconds

  • SAVE_REQUEST_LOGSfalseSave per-request logs to disk

    Save per-request logs to disk

    values: true, false

  • STREAM_IDLE_TIMEOUT_MS60000Stream idle timeout in milliseconds

    Stream idle timeout in milliseconds

  • STREAMING_MODEautoStreaming mode

    Streaming mode

    values: auto, on, off

  • TOOL_CALLINGtrueEnable tool call parsing

    Enable tool call parsing

    values: true, false

  • USE_CUSTOM_INSTRUCTIONfalseUse custom instruction

    Use custom instruction

    values: true, false

Qwen Gate releases & version history

More in API Gateway

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…