mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 21:30:44 +00:00
* 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>
33 lines
833 B
JSON
33 lines
833 B
JSON
{
|
|
"id": "litellm",
|
|
"enabledByDefault": true,
|
|
"providers": ["litellm"],
|
|
"providerAuthEnvVars": {
|
|
"litellm": ["LITELLM_API_KEY"]
|
|
},
|
|
"providerAuthChoices": [
|
|
{
|
|
"provider": "litellm",
|
|
"method": "api-key",
|
|
"choiceId": "litellm-api-key",
|
|
"choiceLabel": "LiteLLM API key",
|
|
"choiceHint": "Unified gateway for 100+ LLM providers",
|
|
"groupId": "litellm",
|
|
"groupLabel": "LiteLLM",
|
|
"groupHint": "Unified LLM gateway (100+ providers)",
|
|
"optionKey": "litellmApiKey",
|
|
"cliFlag": "--litellm-api-key",
|
|
"cliOption": "--litellm-api-key <key>",
|
|
"cliDescription": "LiteLLM API key"
|
|
}
|
|
],
|
|
"contracts": {
|
|
"imageGenerationProviders": ["litellm"]
|
|
},
|
|
"configSchema": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {}
|
|
}
|
|
}
|