Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

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

Ishaan Jaff8d78519adbb9
diff --git a/litellm/proxy/google_endpoints/endpoints.py b/litellm/proxy/google_endpoints/endpoints.py
new file mode 100644
index 00000000000..81e71b7b3ef
--- /dev/null
+++ b/litellm/proxy/google_endpoints/endpoints.py
@@ -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"],
+)
+
+
[email protected]("/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 {}
+
+
[email protected]("/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 {}
+
+
[email protected]("/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 {}
+
diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py
index 0a8abdd19ec..e0004bebc97 100644
--- a/litellm/proxy/proxy_server.py
+++ b/litellm/proxy/proxy_server.py
@@ -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)