feat(llm): auto-detect max images per request for LLM providers

Add binary-search probe endpoint POST /providers/{id}/probe-max-images
that discovers the per-request image limit by sending incrementally
more 1x1 JPEGs via the provider's own API. Result is cached in the
new max_images column on the provider config.

- LLMProviderConfig: add max_images: int | None
- LLMProvider (SQLAlchemy): add max_images column
- Migration ed28d34edde7: clean ADD COLUMN
- LLMProviderService: create/update/set_max_images
- POST /providers/{id}/probe-max-images: binary search + error parsing
- ProviderConfig.svelte: 'Detect' button in edit modal + HelpTooltip
- i18n (en/ru): 11 new keys for probe UI
This commit is contained in:
2026-05-31 22:31:36 +03:00
parent 652de471d2
commit 5e5f958eaa
8 changed files with 414 additions and 13 deletions

View File

@@ -29,6 +29,7 @@ class LLMProviderConfig(BaseModel):
default_model: str
is_active: bool = True
is_multimodal: bool = False
max_images: int | None = None
# #endregion LLMProviderConfig
# #region ValidationStatus [TYPE Class]