langchain-ai / opengpts

MIT License
6.41k stars 844 forks source link

LM Studio #9

Open reinan18 opened 10 months ago

reinan18 commented 10 months ago

"Can I use LM Studio instead of the OpenAI API, Claude2, and others?"

meirm commented 10 months ago

LM Studio is mimicking the OpenAI chat completion API, the way you can tweak openai api to use LM studio is by setting the api_base to the URL where you are running LM studio. i.e. If you're using an OpenAI client, set openai.api_base (python), or the baseURL (node.js) property in your client configuration to "http://localhost:1234/v1"

grasool commented 7 months ago
from langchain_openai import ChatOpenAI
chat = ChatOpenAI(temperature=0.0, base_url="http://localhost:1234/v1", api_key="not-needed")
alaeddine-hash commented 6 months ago

now if i want to consume mistral with LM studio from a django app how can i use this with langchain