Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: 如何连接LMstudio? #1718

Open
wjxxyz opened this issue Apr 18, 2024 · 0 comments
Open

[Feature]: 如何连接LMstudio? #1718

wjxxyz opened this issue Apr 18, 2024 · 0 comments

Comments

@wjxxyz
Copy link

wjxxyz commented Apr 18, 2024

Class | 类型

大语言模型

Feature Request | 功能请求

我使用的是qwen1.5 32b,使用LMstdio启动并暴露接口,如果我想连接他,我应该调整哪些参数

Example: reuse your existing OpenAI setup

from openai import OpenAI

Point to the local server

client = OpenAI(base_url="http://localhost:12345/v1", api_key="lm-studio")

completion = client.chat.completions.create(
model="Qwen/qwen1_5-14b-chat-q2_k",
messages=[
{"role": "system", "content": "Always answer in rhymes."},
{"role": "user", "content": "Introduce yourself."}
],
temperature=0.7,
)

print(completion.choices[0].message)

@wjxxyz wjxxyz changed the title [Feature]: 如何连接LMstdio? [Feature]: 如何连接LMstudio? Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant