Skip to content

Commit 58d73d1

Browse files
committed
update readme
1 parent 395a745 commit 58d73d1

File tree

5 files changed

+2992
-2980
lines changed

5 files changed

+2992
-2980
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
本项目依托fastchat的基础能力来提供**openai server**的能力.
1616

17-
1. 支持**Chat****Embedding****ReRanker****text-moderation(文本审核,分类)****ASR****TTS(支持声音克隆)** **SD(Stable Diffusion,文生图)** 模型的 **openai**规范 接口服务。
17+
1. 支持**Chat****Embedding****ReRanker****text-moderation(文本审核,分类)****ASR****TTS(支持声音克隆)****SD(Stable Diffusion,文生图、文生视频、图片编辑、)** 模型的 **openai**规范 接口服务。
1818
2. 支持**HF****vLLM****LMDeploy****SGLang** 多种加速推理后端引擎。
1919
3. 多个模型共用**openai server**的同一个端口进行调用,自动进行模型调度。
2020

@@ -31,6 +31,7 @@
3131
| 📱 | **ASR(语音转文本)** | 支持基于`FunASR`的ASR模型 |
3232
| 🔊 | **TTS(文本转语音)** | 支持基于`SparkTTS`的TTS模型,支持基于`vLLM``SGLang`后端对齐加速,`RTF<<1`,支持流式音频流输出 |
3333
| 🖌️ | **SD(Stable Diffusion,文生图)** | 支持基于`diffusers``文生图` 模型 |
34+
| 🏔️ | **SD(Stable Diffusion,图片编辑)** | 支持基于`diffusers``图片编辑` 模型 |
3435
| 🔄 | **支持LM/VL模型** | 支持多种大语言模型或多模态语言模型 |
3536
| 🎭 | **推理服务性能测试** | 基于`Evalscope`实现`Throughput``TTFT``TPOT`等服务性能指标 |
3637

@@ -44,6 +45,7 @@
4445
- 全球唯一支持了**openai**库的TTS模型接口(tts, /v1/audio/speech)(代码样例见gpt_server/tests/test_openai_tts_stream.py)
4546
- 全球唯一支持了**openai**库的ASR模型接口(asr, /v1/audio/transcriptions),基于fanasr后端(代码样例见gpt_server/tests/test_openai_transcriptions.py)
4647
- 全球唯一支持了**openai**库的SD,文生图模型接口(sd, /v1/images/generations),基于diffusers后端(代码样例见gpt_server/tests/test_image_gen.py)
48+
- - 全球唯一支持了**openai**库的SD,文生图模型接口(sd, /v1/images/edits),基于diffusers后端(代码样例见gpt_server/tests/test_image_edit.py)
4749

4850
## 🖼️ 配置文档
4951
通过这个样例文件,可以很快的掌握项目的配置方式。
@@ -55,6 +57,7 @@
5557
<summary><b>2025</b></summary>
5658

5759
```plaintext
60+
2025-9-7 支持了 文本编辑模型 (代码样例见gpt_server/tests/test_image_edit.py)
5861
2025-8-8 初步支持了 embedding 的 vllm 加速
5962
2025-6-17 支持了 jina-reranker-m0 全球首个支持多模态多语言的重排模型
6063
2025-6-12 支持了 文生图模型 flux (代码样例见gpt_server/tests/test_image_gen.py)

gpt_server/model_worker/base/model_worker_base.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,8 @@ def run(cls):
256256
parser.add_argument("--task_type", type=str, default="auto")
257257
# limit_worker_concurrency
258258
parser.add_argument("--limit_worker_concurrency", type=int, default=1024)
259+
# port
260+
parser.add_argument("--port", type=int, default=None)
259261
args = parser.parse_args()
260262
os.environ["num_gpus"] = str(args.num_gpus)
261263
if args.backend == "vllm":
@@ -288,12 +290,13 @@ def run(cls):
288290
logger.remove(0)
289291
log_level = os.getenv("log_level", "WARNING")
290292
logger.add(sys.stderr, level=log_level)
291-
292293

293294
host = args.host
294295
controller_address = args.controller_address
295-
296-
port = get_free_tcp_port()
296+
if args.port:
297+
port = args.port
298+
else:
299+
port = get_free_tcp_port()
297300
os.environ["WORKER_PORT"] = str(port)
298301
os.environ["WORKER_HOST"] = str(local_ip)
299302
worker_addr = f"http://{host}:{port}"

gpt_server/script/config_example.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ models:
195195
model_type: qwen_image_edit
196196
work_mode: hf
197197
device: gpu
198+
port: 8084 # 支持手动设置端口
198199
workers:
199200
- gpus:
200201
- 7

gpt_server/utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ def start_model_worker(config: dict):
239239
CUDA_VISIBLE_DEVICES = ""
240240
else:
241241
raise Exception("目前仅支持 CPU/GPU设备!")
242+
port = model_config.get("port", None)
242243
backend = model_config["work_mode"]
243244
if model_type == "embedding":
244245
assert backend in embedding_backend_type
@@ -264,6 +265,8 @@ def start_model_worker(config: dict):
264265
+ f" --limit_worker_concurrency {limit_worker_concurrency}" # 限制worker并发数
265266
)
266267
# 处理为 None的情况
268+
if port:
269+
cmd += f" --port {port}"
267270
if lora:
268271
cmd += f" --lora '{json.dumps(lora)}'"
269272
if max_model_len:

0 commit comments

Comments
 (0)