This commit is contained in:
2026-03-28 21:25:25 +08:00
parent 1af1cca42c
commit 15d26b0cbd
3 changed files with 26 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
from openai import OpenAI
client = OpenAI(
base_url="http://192.168.0.11:8000/v1",
api_key="dummy" # vLLM 不需要真实的 API key
)
# 聊天完成
response = client.chat.completions.create(
model="/opt/model/Qwen3-Next-80B-A3B-Instruct-AWQ-4bit",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "你好,请介绍一下你自己"}
],
max_tokens=500,
temperature=0.7
)
print(response.choices[0].message.content)