Closed zsychn closed 1 month ago
server.py
in the folder backend/openui
- line 68base_url
to whatever you wish.openai = AsyncOpenAI(
base_url="https://YOUR-URL/v1"
) # AsyncOpenAI(base_url="http://127.0.0.1:11434/v1")
ollama = AsyncClient()
router = APIRouter()
session_store = DBSessionStore()
github_sso = GithubSSO(
config.GITHUB_CLIENT_ID, config.GITHUB_CLIENT_SECRET, f"{config.HOST}/v1/callback"
)
Thank you so much. I will try it right away. Thank you.
Love this! Thanks @mmuyakwa. I'll look into making this configurable / extensible.
File
server.py
in the folderbackend/openui
- line 68Set the
base_url
to whatever you wish.openai = AsyncOpenAI( base_url="https://YOUR-URL/v1" ) # AsyncOpenAI(base_url="http://127.0.0.1:11434/v1") ollama = AsyncClient() router = APIRouter() session_store = DBSessionStore() github_sso = GithubSSO( config.GITHUB_CLIENT_ID, config.GITHUB_CLIENT_SECRET, f"{config.HOST}/v1/callback" )
NO no no, it can not work after change the base_url in the server.py at AsyncOpenAI(base_url="http://192.168.1.103:11434/v1"), when i run python -m openui
, the error is as follows:
the api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable.
@zhjygit Unfortunately the app always requires the "OPENAI_API_KEY" to be set, whether you use it or not. If you don't require it, then set it with something. Anything. It just has to be present.
In my case I used it for Groq. I entered the Groq-API-Key and changed the base_url to the url of Groq's API.
Otherwise take a look at the following: https://github.com/wandb/openui/issues/73#issuecomment-2099840072
I've tried to directly modify the baseURL in openai.ts several times, but without success. I would appreciate any help, thank you.