You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
440 B
Python
13 lines
440 B
Python
from openai import OpenAI
|
|
# 配置本地模型
|
|
llm = OpenAI(
|
|
model="qwen3-30b-a3b-instruct-2507", # 本地模型名称
|
|
api_key="gpustack_951f92355e6781a5_5d17650a3e7135c5430512e5117362fb", # 本地模型通常不需要有效密钥
|
|
base_url="http://192.168.5.20:4090/v1", # 本地模型服务地址
|
|
temperature=0
|
|
)
|
|
# 调用模型
|
|
response = llm.invoke("你好,介绍一下你自己,你是傻逼")
|
|
print(response.content)
|
|
|