llmware icon indicating copy to clipboard operation
llmware copied to clipboard

Assigning a "base_url"

Open Francisco-Reveriano opened this issue 2 years ago • 2 comments

Hello Team. Love the library. I am working with the Prompt().load_model() function.

I can assign an api_key but it doesn't allow me to assign a "Bare_url" to use that key.

Would appreciate any help.

Francisco-Reveriano avatar Dec 18 '23 17:12 Francisco-Reveriano

thanks for the feedback - which model are you trying to use?

doberst avatar Dec 19 '23 16:12 doberst

If you use openai version >1.0

setup OPENAI_BASE_URL = "your base url"

Else (openai version == 0.27.7) setup OPENAI_API_BASE = "your base url" # http://127.0.0.1:8000 my case using litellm as a Open AI proxy server

LLMware wappaped openai in its llm model.

Import openai # version 0.27.7

openai.api_base=os.environ.get("OPENAI_BASE_URL ") or or openai.api_base=os.environ.get("OPENAI_API_BASE")

dtthanh1971 avatar Dec 20 '23 02:12 dtthanh1971

@dtthan1971 - FYI, we added OpenChat support last week. This should enable you to support this use case. Please check out the example in Examples/Models in the file: using-open-chat-models.py - link

doberst avatar Jan 15 '24 14:01 doberst