mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
enforce ft endpoints as premium feature
This commit is contained in:
parent
bd15d0f4ca
commit
9759fabe8f
1 changed files with 15 additions and 0 deletions
|
@ -112,12 +112,17 @@ async def create_fine_tuning_job(
|
||||||
add_litellm_data_to_request,
|
add_litellm_data_to_request,
|
||||||
general_settings,
|
general_settings,
|
||||||
get_custom_headers,
|
get_custom_headers,
|
||||||
|
premium_user,
|
||||||
proxy_config,
|
proxy_config,
|
||||||
proxy_logging_obj,
|
proxy_logging_obj,
|
||||||
version,
|
version,
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
if premium_user is not True:
|
||||||
|
raise ValueError(
|
||||||
|
f"Only premium users can use this endpoint + {CommonProxyErrors.not_premium_user.value}"
|
||||||
|
)
|
||||||
# Convert Pydantic model to dict
|
# Convert Pydantic model to dict
|
||||||
data = fine_tuning_request.model_dump(exclude_none=True)
|
data = fine_tuning_request.model_dump(exclude_none=True)
|
||||||
|
|
||||||
|
@ -230,6 +235,7 @@ async def list_fine_tuning_jobs(
|
||||||
add_litellm_data_to_request,
|
add_litellm_data_to_request,
|
||||||
general_settings,
|
general_settings,
|
||||||
get_custom_headers,
|
get_custom_headers,
|
||||||
|
premium_user,
|
||||||
proxy_config,
|
proxy_config,
|
||||||
proxy_logging_obj,
|
proxy_logging_obj,
|
||||||
version,
|
version,
|
||||||
|
@ -237,6 +243,10 @@ async def list_fine_tuning_jobs(
|
||||||
|
|
||||||
data: dict = {}
|
data: dict = {}
|
||||||
try:
|
try:
|
||||||
|
if premium_user is not True:
|
||||||
|
raise ValueError(
|
||||||
|
f"Only premium users can use this endpoint + {CommonProxyErrors.not_premium_user.value}"
|
||||||
|
)
|
||||||
# Include original request and headers in the data
|
# Include original request and headers in the data
|
||||||
data = await add_litellm_data_to_request(
|
data = await add_litellm_data_to_request(
|
||||||
data=data,
|
data=data,
|
||||||
|
@ -337,6 +347,7 @@ async def retrieve_fine_tuning_job(
|
||||||
add_litellm_data_to_request,
|
add_litellm_data_to_request,
|
||||||
general_settings,
|
general_settings,
|
||||||
get_custom_headers,
|
get_custom_headers,
|
||||||
|
premium_user,
|
||||||
proxy_config,
|
proxy_config,
|
||||||
proxy_logging_obj,
|
proxy_logging_obj,
|
||||||
version,
|
version,
|
||||||
|
@ -344,6 +355,10 @@ async def retrieve_fine_tuning_job(
|
||||||
|
|
||||||
data: dict = {}
|
data: dict = {}
|
||||||
try:
|
try:
|
||||||
|
if premium_user is not True:
|
||||||
|
raise ValueError(
|
||||||
|
f"Only premium users can use this endpoint + {CommonProxyErrors.not_premium_user.value}"
|
||||||
|
)
|
||||||
# Include original request and headers in the data
|
# Include original request and headers in the data
|
||||||
data = await add_litellm_data_to_request(
|
data = await add_litellm_data_to_request(
|
||||||
data=data,
|
data=data,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue