mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 03:34:10 +00:00
fix: allow api base to be set for all providers
enables proxy use cases
This commit is contained in:
parent
72f55a4e6c
commit
00993f3575
7 changed files with 76 additions and 11 deletions
|
@ -80,6 +80,7 @@ def validate_environment(api_key):
|
|||
def completion(
|
||||
model: str,
|
||||
messages: list,
|
||||
api_base: str,
|
||||
model_response: ModelResponse,
|
||||
print_verbose: Callable,
|
||||
encoding,
|
||||
|
@ -129,7 +130,7 @@ def completion(
|
|||
and optional_params["stream_tokens"] == True
|
||||
):
|
||||
response = requests.post(
|
||||
"https://api.together.xyz/inference",
|
||||
api_base,
|
||||
headers=headers,
|
||||
data=json.dumps(data),
|
||||
stream=optional_params["stream_tokens"],
|
||||
|
@ -137,7 +138,7 @@ def completion(
|
|||
return response.iter_lines()
|
||||
else:
|
||||
response = requests.post(
|
||||
"https://api.together.xyz/inference",
|
||||
api_base,
|
||||
headers=headers,
|
||||
data=json.dumps(data)
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue