Skip to content

Commit 2ebff2f

Browse files
Sameerlitegithub-advanced-security[bot]ishaan-jaff
authored andcommitted
Add Vertex and Gemini Videos API with Cost Tracking + UI support (BerriAI#16323)
* Use video id for videos api * remove mock code * Potential fix for code scanning alert no. 3630: Clear-text logging of sensitive information Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * remove print statements * Update video prefix for 'video_' * Add veo with openai videos unified specs * Add videos testing to UI * remove mock code * Remove not need ui changes: * Fix mypy errors related to gemini * fix test_transform_video_create_request * Add vertex ai veo config * Add vertex ai veo config * Add cost tracking for gemini and add optional param passing * fix bugs related to vertex ai veo * Add Gemini Veo Video Generation in Openai Videos Unified Spec (BerriAI#16229) * Add veo with openai videos unified specs * Add videos testing to UI * remove mock code * Remove not need ui changes: * Fix mypy errors related to gemini * fix test_transform_video_create_request * Add contant video duration for gemini and vertex * Fix litellm_mapped_tests tests * fix azure videos issue * Added doc for videos vertex ai * fix seconds param error * fix lint errors * test_transform_video_create_response_cost_tracking_no_duration --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Co-authored-by: Ishaan Jaffer <ishaanjaffer0324@gmail.com>
1 parent 0e93648 commit 2ebff2f

File tree

41 files changed

+3757
-206
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+3757
-206
lines changed

docs/my-website/docs/providers/azure/videos.md

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ LiteLLM supports Azure OpenAI's video generation models including Sora with full
2525
import os
2626
os.environ["AZURE_OPENAI_API_KEY"] = "your-azure-api-key"
2727
os.environ["AZURE_OPENAI_API_BASE"] = "https://your-resource.openai.azure.com/"
28-
os.environ["AZURE_OPENAI_API_VERSION"] = "2024-02-15-preview"
2928
```
3029

3130
### Basic Usage
@@ -37,7 +36,6 @@ import time
3736

3837
os.environ["AZURE_OPENAI_API_KEY"] = "your-azure-api-key"
3938
os.environ["AZURE_OPENAI_API_BASE"] = "https://your-resource.openai.azure.com/"
40-
os.environ["AZURE_OPENAI_API_VERSION"] = "2024-02-15-preview"
4139

4240
# Generate video
4341
response = video_generation(
@@ -53,8 +51,7 @@ print(f"Initial Status: {response.status}")
5351
# Check status until video is ready
5452
while True:
5553
status_response = video_status(
56-
video_id=response.id,
57-
custom_llm_provider="azure"
54+
video_id=response.id
5855
)
5956

6057
print(f"Current Status: {status_response.status}")
@@ -69,8 +66,7 @@ while True:
6966

7067
# Download video content when ready
7168
video_bytes = video_content(
72-
video_id=response.id,
73-
custom_llm_provider="azure"
69+
video_id=response.id
7470
)
7571

7672
# Save to file
@@ -87,7 +83,6 @@ Here's how to call Azure video generation models with the LiteLLM Proxy Server
8783
```bash
8884
export AZURE_OPENAI_API_KEY="your-azure-api-key"
8985
export AZURE_OPENAI_API_BASE="https://your-resource.openai.azure.com/"
90-
export AZURE_OPENAI_API_VERSION="2024-02-15-preview"
9186
```
9287

9388
### 2. Start the proxy
@@ -102,7 +97,6 @@ model_list:
10297
model: azure/sora-2
10398
api_key: os.environ/AZURE_OPENAI_API_KEY
10499
api_base: os.environ/AZURE_OPENAI_API_BASE
105-
api_version: "2024-02-15-preview"
106100
```
107101
108102
</TabItem>
@@ -211,8 +205,7 @@ general_settings:
211205
```python
212206
# Download video content
213207
video_bytes = video_content(
214-
video_id="video_1234567890",
215-
model="azure/sora-2"
208+
video_id="video_1234567890"
216209
)
217210
218211
# Save to file
@@ -243,8 +236,7 @@ def generate_and_download_video(prompt):
243236
244237
# Step 3: Download video
245238
video_bytes = litellm.video_content(
246-
video_id=video_id,
247-
custom_llm_provider="azure"
239+
video_id=video_id
248240
)
249241
250242
# Step 4: Save to file
@@ -264,9 +256,9 @@ video_file = generate_and_download_video(
264256
```python
265257
# Video editing with reference image
266258
response = litellm.video_remix(
259+
video_id="video_456",
267260
prompt="Make the cat jump higher",
268261
input_reference=open("path/to/image.jpg", "rb"), # Reference image as file object
269-
custom_llm_provider="azure"
270262
seconds="8"
271263
)
272264

docs/my-website/docs/providers/gemini.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import TabItem from '@theme/TabItem';
1010
| Provider Route on LiteLLM | `gemini/` |
1111
| Provider Doc | [Google AI Studio ↗](https://aistudio.google.com/) |
1212
| API Endpoint for Provider | https://generativelanguage.googleapis.com |
13-
| Supported OpenAI Endpoints | `/chat/completions`, [`/embeddings`](../embedding/supported_embedding#gemini-ai-embedding-models), `/completions` |
13+
| Supported OpenAI Endpoints | `/chat/completions`, [`/embeddings`](../embedding/supported_embedding#gemini-ai-embedding-models), `/completions`, [`/videos`](./gemini/videos.md) |
1414
| Pass-through Endpoint | [Supported](../pass_through/google_ai_studio.md) |
1515

1616
<br />

0 commit comments

Comments
 (0)