mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-26 22:30:11 +00:00
* feat(gateway): Gemini chat completions on Google AI Studio and Vertex AI gemini/ deployments and vertex_ai/ deployments of Gemini models now serve /v1/chat/completions, streamed and not, instead of being refused. Both surfaces share one translation ported from the Python VertexGeminiConfig. Params map as Python maps them: temperature, top_p, max_tokens and max_completion_tokens, n, stop, penalties where the model takes them, seed, logprobs, tools with function declarations and the built in search, code execution, url context, maps and computer use tools, tool_choice, response_format as a response schema, reasoning_effort and thinking as a thinking config, modalities, audio and labels. Messages become contents with a system instruction when the cost map allows it, images, files, audio, function calls and responses, and thought signatures carried back on tool call ids AI Studio sends the key in x-goog-api-key from the deployment or GOOGLE_API_KEY, GEMINI_API_KEY or PALM_API_KEY, and calls v1alpha for Gemini 3 and v1beta otherwise. Vertex AI calls the project and location URL with a forwarded bearer or a Google access token from vertex_credentials, the environment or ADC, and grafts the path onto a custom api_base. Responses carry text, reasoning, tool calls, grounding annotations, logprobs and the vertex_ai metadata, a blocked prompt or flagged answer comes back as content_filter, and usage counts thoughts and cached tokens as Python does so cost is recorded. The gateway resolves os.environ references in the deployment key, base and Vertex params, passes the deployment Vertex params to the call, and loads the cost map for gemini and vertex_ai deployments. Claude and partner models on Vertex AI stay refused * test(gateway): gemini cost map test double returns a Cow entry |
||
|---|---|---|
| .. | ||
| benches | ||
| generated | ||
| scripts | ||
| src | ||
| tests | ||
| AGENTS.md | ||
| Cargo.toml | ||