OpenAI mechanism for marking a model as "does not accept attachment URLs"
This came up here:
- https://github.com/simonw/llm-lm-studio/issues/1#issuecomment-2993650842
I've now abandoned that plugin (llm-lmstudio exists already) but it would still be good to make it so OpenAI-compatible models that don't support URL attachments directly can still work.
Relevant code: https://github.com/simonw/llm/blob/0bf655a1feabb8a57497d920dfe20f04df895668/llm/default_plugins/openai_models.py#L430-L435
I think a supports_url_attachments property may be the way to go here. It can be passed to that _attachment() function.
I would like to work on this. Current main still forwards remote image URLs directly, and does not expose the suggested supports_url_attachments capability.
I plan to add an opt-in supports_url_attachments=False setting for OpenAI-compatible model instances and extra-openai-models.yaml. With that setting, remote images will use the existing attachment download/base64 path before the model request. The default will remain URL passthrough. I'll cover sync/async requests, image detail, configured models, and error propagation with mocked HTTP tests, and document the setting. I will keep Chat Completions and Responses handling consistent.
AI assistance is being used for implementation and validation. Tests will not require LM Studio, a GPU, or paid API calls.