部署价值190万的昇腾910B1 - 8卡64G服务器部署QWen3-235B

分类:AI |

体验价值190万的昇腾910B1 - 8卡64G服务器部署QWen3-235B: 
内存: 1.5T 

cpu: 192核

显存: 8卡64G

价格: 180~190 W

用了几天时间, 基本部署好了, 32B 与 235B 的qwen模型 用起来还是很流畅的


image.png


写个脚本试用一下: 


from openai import OpenAI

client = OpenAI(
    api_key="local-test",  # 如果服务端校验 Key,替换为实际的 ASCII Key
    base_url="http://localhost:1025/v1/",
)


def send_message_to_bot(message):
    stream = client.chat.completions.create(
        model="qwen3",
        messages=[{"role": "user", "content": message}],
        stream=True,
    )

    for chunk in stream:
        if not chunk.choices:
            continue

        text = chunk.choices[0].delta.content
        if text:
            print(text, end="", flush=True)

    print()


print("开始与 AI 聊天(输入 exit 退出)")
while True:
    user_input = input("你: ").strip()
    if user_input.lower() == "exit":
        break
    if not user_input:
        continue

    print("AI: ", end="", flush=True)
    send_message_to_bot(user_input)
from openai import OpenAI

client = OpenAI(
    api_key="sk-no-key-required",  # ✅ 改成纯英文/数字,解决报错
    base_url="http://localhost:1025/v1/"
)

def send_message_to_bot(message):
    print("AI: ", end="", flush=True)  # 先打印前缀,不换行
    response = client.chat.completions.create(
        messages=[
            {'role': 'user', 'content': message},
        ],
        model='qwen3',
        stream=True
    )

    for chunk in response:
        # delta.content 有时为 None,需要判断一下避免打印 None
        if chunk.choices and chunk.choices[0].delta.content:
            print(chunk.choices[0].delta.content, end="", flush=True)
    print()  # 流式结束后换行

print("开始与AI聊天 (输入'exit'退出)")
while True:
    user_input = input("你: ")
    if user_input.lower() == 'exit':
        break
    send_message_to_bot(user_input)


无
阅读( 2259 ) |