convaiinnovations/fastapi-qwen-api

🤗 Hugging Face 来源apache-2.0-other⚠ 没有 SHA-256 权重今天更新
一条命令提交

在你的模型文件夹旁边运行它。它会制作种子、将文件与 Hugging Face 比对,然后提交。你只需开始做种,并粘贴你账户中的密钥。它只读取你的文件,绝不修改。如果愿意,可以先阅读脚本。

curl -fsSL https://pirateface.co/package.sh | bash -s -- --repo convaiinnovations/fastapi-qwen-api ./model-folder
需要做种者 →

FastAPI Qwen 0.6B REST API

This repository contains a production-ready (though lightweight) wrapper for the Qwen/Qwen3-0.6B model using FastAPI and JWT authentication.

Features

  • FastAPI Backend: Efficient RESTful endpoints.
  • JWT Security: Token-based authentication for the /generate endpoint.
  • Thinking Toggle: Option to hide or show the model's internal reasoning/thinking blocks via regex filtering.
  • OpenAI Chat Format: Compatible with list-of-messages input.

Files

  • app.py: The core FastAPI server logic.
  • generate_jwt.py: Utility to create access tokens.
  • client.py: Demo script for performing inference.

Quick Start

  1. Install dependencies: pip install fastapi uvicorn transformers torch pyjwt python-dotenv requests.
  2. Set your SECRET_KEY in a .env file.
  3. Run python app.py.
  4. Use client.py to send requests.