[Feat] Add initial endpoints for using Gemini SDK (gemini-cli) with LiteLLM (#12040)

* init with google endpoints

* add Depends
This commit is contained in:
Ishaan Jaff
2025-06-25 15:12:25 -07:00
committed by GitHub
parent 2a6dab0d23
commit 8d78519adb
2 changed files with 34 additions and 0 deletions
@@ -0,0 +1,32 @@
from fastapi import APIRouter, Depends, Request
from litellm.proxy.auth.user_api_key_auth import user_api_key_auth
router = APIRouter(
tags=["google genai endpoints"],
)
@router.post("/v1beta/models/{model_name}:countTokens", dependencies=[Depends(user_api_key_auth)])
async def google_count_tokens(request: Request, model_name: str):
"""
Not Implemented, this is a placeholder for the google genai countTokens endpoint.
"""
return {}
@router.post("/v1beta/models/{model_name}:generateContent", dependencies=[Depends(user_api_key_auth)])
async def google_generate_content(request: Request, model_name: str):
"""
Not Implemented, this is a placeholder for the google genai generateContent endpoint.
"""
return {}
@router.post("/v1beta/models/{model_name}:streamGenerateContent", dependencies=[Depends(user_api_key_auth)])
async def google_stream_generate_content(request: Request, model_name: str):
"""
Not Implemented, this is a placeholder for the google genai streamGenerateContent endpoint.
"""
return {}
+2
View File
@@ -212,6 +212,7 @@ from litellm.proxy.db.exception_handler import PrismaDBExceptionHandler
from litellm.proxy.discovery_endpoints import ui_discovery_endpoints_router
from litellm.proxy.fine_tuning_endpoints.endpoints import router as fine_tuning_router
from litellm.proxy.fine_tuning_endpoints.endpoints import set_fine_tuning_config
from litellm.proxy.google_endpoints.endpoints import router as google_router
from litellm.proxy.guardrails.guardrail_endpoints import router as guardrails_router
from litellm.proxy.guardrails.init_guardrails import (
init_guardrails_v2,
@@ -8590,6 +8591,7 @@ app.include_router(credential_router)
app.include_router(llm_passthrough_router)
app.include_router(mcp_management_router)
app.include_router(anthropic_router)
app.include_router(google_router)
app.include_router(langfuse_router)
app.include_router(pass_through_router)
app.include_router(health_router)