Open daisukes opened 3 months ago
When I want to connect to an OpenAI compatible proxy server (i.e. litellm), it does not accept requests including /v1 in the URL.
/v1
http://localhost:8000/chat/completion
http://localhost:8000/v1/chat/completion
The official OpenAI python library has base_url option to create client and the default base_url contains /v1
base_url
if base_url is None: base_url = f"https://api.openai.com/v1"
I can make a client for my proxy like
client = openai.OpenAI(api_key="api-key", base_url="http://localhost:8000")
So, I want base_url support instead of host, port and scheme configuration here.
https://github.com/MacPaw/OpenAI/blob/843e087929aa806adb611dbca93f9a4a7f28be04/Sources/OpenAI/OpenAI.swift#L30
Also, I want APIPath not including /v1 and move it to base_url
https://github.com/MacPaw/OpenAI/blob/843e087929aa806adb611dbca93f9a4a7f28be04/Sources/OpenAI/OpenAI.swift#L211-L231
When I want to connect to an OpenAI compatible proxy server (i.e. litellm), it does not accept requests including
/v1
in the URL.http://localhost:8000/chat/completion
http://localhost:8000/v1/chat/completion
The official OpenAI python library has
base_url
option to create client and the defaultbase_url
contains/v1
I can make a client for my proxy like
So, I want
base_url
support instead of host, port and scheme configuration here.https://github.com/MacPaw/OpenAI/blob/843e087929aa806adb611dbca93f9a4a7f28be04/Sources/OpenAI/OpenAI.swift#L30
Also, I want APIPath not including
/v1
and move it tobase_url
https://github.com/MacPaw/OpenAI/blob/843e087929aa806adb611dbca93f9a4a7f28be04/Sources/OpenAI/OpenAI.swift#L211-L231