Skip to content

feat(pricing): gemini-embedding-2 GA cost map, blog, and test#26391

Open
Sameerlite wants to merge 2 commits intolitellm_internal_stagingfrom
litellm_gemini_embedding_2_ga_cost_map_blog
Open

feat(pricing): gemini-embedding-2 GA cost map, blog, and test#26391
Sameerlite wants to merge 2 commits intolitellm_internal_stagingfrom
litellm_gemini_embedding_2_ga_cost_map_blog

Conversation

@Sameerlite
Copy link
Copy Markdown
Collaborator

@Sameerlite Sameerlite commented Apr 24, 2026

Summary

  • Register gemini-embedding-2 (GA) in model_prices_and_context_window.json and backup for Gemini and Vertex-style keys.
  • Add blog gemini_embedding_2_ga with proxy-only /v1/embeddings curl examples.
  • Add test_gemini_embedding_2_ga_in_cost_map to lock multimodal unit pricing fields.

Test plan

poetry run pytest tests/test_litellm/test_utils.py::test_gemini_embedding_2_ga_in_cost_map -v
image

- Add model_prices entries for gemini-embedding-2 (Gemini + Vertex paths)
- Add docs blog gemini_embedding_2_ga with LiteLLM proxy curl examples
- Add test_gemini_embedding_2_ga_in_cost_map in test_utils

Made-with: Cursor
@veria-ai
Copy link
Copy Markdown

veria-ai Bot commented Apr 24, 2026

Low: No security issues found

This PR adds pricing/cost-map entries for a new Gemini embedding model, a blog post documenting the feature, and a test verifying the cost map entries. All changes are to documentation, static JSON configuration data, and tests — no runtime code is modified.


Status: 0 open
Risk: 1/10

Posted by Veria AI · 2026-04-24T06:28:48.450Z

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 24, 2026

Greptile Summary

This PR registers the GA release of gemini-embedding-2 in the cost map (both primary and backup JSON), adds a blog post, and adds a test to lock the pricing fields. Three entries are added (gemini-embedding-2, vertex_ai/gemini-embedding-2, gemini/gemini-embedding-2) with pricing fields matching the preview model.

Prior review concerns are addressed: the bare-key gemini-embedding-2 entry now includes supports_multimodal: true, and uses_embed_content: true is correctly set on both Vertex AI entries. The gemini/ entry correctly omits uses_embed_content because that flag is only consumed in the Vertex AI code path (main.py:5242, common_utils.py:271) via custom_llm_provider=\"vertex_ai\".

Confidence Score: 5/5

Safe to merge — all three cost map entries are internally consistent and correct, prior concerns are resolved.

No P0 or P1 issues found. Both previously flagged concerns (missing supports_multimodal on bare key, uses_embed_content consistency) are addressed in this PR. The test correctly validates all pricing and routing fields without making real network calls.

No files require special attention.

Important Files Changed

Filename Overview
model_prices_and_context_window.json Adds three GA entries for gemini-embedding-2 (bare key, vertex_ai/, gemini/) with consistent pricing fields and correct uses_embed_content/supports_multimodal flags.
litellm/model_prices_and_context_window_backup.json Backup JSON updated identically to the primary; all three GA entries are consistent with the primary file.
tests/test_litellm/test_utils.py New test reads JSON from filesystem (no network calls) and validates pricing fields and routing flags for all three GA entries.
docs/my-website/blog/gemini_embedding_2_ga/index.md New blog post documenting GA model name, proxy config, and SDK usage examples; no code changes.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["embedding(model=...)"] --> B{Parse provider}
    B -->|"gemini/gemini-embedding-2"| C["Gemini API path\n(generativelanguage.googleapis.com)"]
    B -->|"vertex_ai/gemini-embedding-2"| D["Vertex AI path"]
    B -->|"gemini-embedding-2 (bare key)"| E["vertex_ai-embedding-models path"]
    D --> F{uses_embed_content?}
    E --> F
    F -->|true| G["embedContent endpoint\n(main.py:5246)"]
    F -->|false| H["predict endpoint"]
    C --> I["Gemini embedContent\n(no flag check needed)"]
Loading

Reviews (2): Last reviewed commit: "Fix greptile reviews" | Re-trigger Greptile

Comment thread tests/test_litellm/test_utils.py
Comment thread model_prices_and_context_window.json
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant