Repository navigation
Conversation
Greptile SummaryThis PR adds xAI Imagine image generation and editing, video creation and retrieval, provider registration, model metadata, proxy request parsing, and focused tests
Confidence Score: 2/5This PR is not safe to merge until xAI status routing selects the correct provider and CDN downloads validate their destination Plain xAI status requests can be dispatched through OpenAI despite an xAI query model, and response-controlled CDN URLs bypass destination validation Files Needing Attention: litellm/proxy/video_endpoints/endpoints.py, litellm/llms/xai/videos/transformation.py
|
| Filename | Overview |
|---|---|
| litellm/llms/xai/videos/transformation.py | Adds xAI video transformations, but the CDN download follows an unvalidated response-controlled URL |
| litellm/proxy/video_endpoints/endpoints.py | Adds model recovery for video status and content, but status retains an OpenAI default that overrides xAI model inference |
| litellm/proxy/video_endpoints/utils.py | Adds model resolution from encoded IDs or query parameters |
| litellm/llms/xai/image_edit/transformation.py | Adds xAI image-edit parameter, authentication, request, and response transformations |
| litellm/llms/xai/image_generation/transformation.py | Adds xAI image-generation parameter, authentication, request, and response transformations |
| litellm/proxy/image_endpoints/endpoints.py | Extends image-edit parsing to support uploaded files, HTTP URLs, and data-image URIs |
| litellm/videos/main.py | Adds provider inference from video IDs and model metadata for status and content operations |
| litellm/images/main.py | Routes xAI image generation through the shared HTTP transformation handler |
Comments Outside Diff (1)
-
litellm/proxy/video_endpoints/endpoints.py, line 261 (link)With a plain xAI ID,
?model=grok-imagine-videostill selects OpenAI, so status requests use the wrong provider and fail
Reviews (1): Last reviewed commit: "fix(proxy): accept image-edit URL and da..." | Re-trigger Greptile
| httpx_client: Final[HTTPHandler] = _get_httpx_client() | ||
| video_response: Final = httpx_client.get(url) |
There was a problem hiding this comment.
A configured upstream can return an internal video.url, which this direct GET follows without destination validation, enabling server-side access to internal networks
How this was verified: The response-controlled video.url reaches an ordinary shared-client GET without the repository's safe-fetch validation
PR overviewAll previously flagged issues have been addressed. No open security concerns remain on this pull request. Security reviewNo open security issues remain on this pull request. Fixed/addressed: 4 · PR risk: 0/10 |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
ce8df28 to
1d8942f
Compare
24d409d to
c510bd1
Compare
005b9f1 to
2ff9f1b
Compare
|
rust-wheel fails on the 45 MB native-size guard, main hit the same failure with #44580. No Rust changes in this PR |
2974e8c to
f850f2d
Compare
|
Automatic reviews are disabled for this repository. |
|
@greptileai review |
0882d9e to
0c471a9
Compare
0c471a9 to
9c3a560
Compare
The xAI create response only carries request_id, so usage was empty and completion_cost priced every created video at zero seconds. Derive usage.duration_seconds and usage.video_resolution from the request body sent to xAI, and forward the resolution param that was being dropped. Also cover the remaining image edit/generation, video, and ownership behaviors that had no tests.
…deo downloads Video content hooks now take the client the HTTP handler passes in, image responses are parsed through one typed helper that raises a provider error when no images come back, and video provider resolution no longer rebinds the custom_llm_provider argument
9c3a560 to
f5f3cce
Compare
|
@ryan-crabbe-berri @mateo-berri @joshua-berri @kerry-berri @klu-berri all five PRs are rebased onto main and merge clean, CI awaits a workflow approval, reviews welcome when you get a chance |
TLDR
Problem this solves:
How it solves it:
This supersedes the Imagine slice of #31611 (closed; mixed production branch). SuperGrok multi-account OAuth failover is left for a separate PR. Staging already has single-account
use_xai_oauthUser Flow
Before: a developer on the proxy cannot use Grok Imagine at all, and nothing is billed
"model": "xai/grok-imagine-image"and get an unsupported provider error"model": "xai/grok-imagine-video"and get an unsupported provider errorAfter: the same requests work end to end and video spend shows up against the key's budget
"seconds": "10"returns a video id, logged at the 10 second price for the chosen resolutionPre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/unit/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or moreDelays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review)
Type
New Feature
Caveats (if any)
Medium
Low
Final Attestation