mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 09:30:43 +00:00
feat(litellm): add image generation provider (#70246)
* feat(litellm): add image generation provider Registers litellm as an image-generation provider so model refs like litellm/gpt-image-2 route through the LiteLLM proxy, and agents.defaults.imageGenerationModel.fallbacks entries of the form litellm/... resolve without "No image-generation provider registered for litellm" errors. Implementation uses the OpenAI-compatible /images/generations and /images/edits endpoints that LiteLLM proxies for. BaseUrl resolves from models.providers.litellm.baseUrl (default http://localhost:4000). Private network is auto-allowed when baseUrl is a loopback/RFC1918 address, which covers the common self-hosted LiteLLM proxy case without needing OPENCLAW_PROVIDER_ALLOW_PRIVATE_NETWORK. Public baseUrls keep normal SSRF defaults. Default model is gpt-image-2 (matching upstream 4.21+ OpenAI default). Advertises the same 2K/4K sizes OpenAI now exposes, plus legacy 256/512/1024 for dall-e-3. Supports both generate and edit. Local patch. LiteLLM has no upstream image-generation support yet; revisit if upstream adds one. * ci: rerun after upstream main hot-fix * fix(litellm): harden image generation provider --------- Co-authored-by: Chris Zhang <chris@ChrisdeMac-mini.local> Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
5
.github/labeler.yml
vendored
5
.github/labeler.yml
vendored
@@ -315,6 +315,11 @@
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "extensions/lmstudio/**"
|
||||
"extensions: litellm":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "extensions/litellm/**"
|
||||
- "docs/providers/litellm.md"
|
||||
"extensions: openai":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
|
||||
Reference in New Issue
Block a user