Skip to content

[Bug] Chat Completions Vision Format Crash #1035

Description

@A795da

Describe the issue

Foundry Local's /v1/chat/completions endpoint severely mishandles standard OpenAI-style image_url inputs. Sending an image in the standard Chat Completions shape triggers a massive request-format bug. The engine attempts to allocate tens of gigabytes of memory, immediately crashing the entire engine.

-Impact: The standard /v1/chat/completions endpoint cannot be used for vision tasks.

(Working alternative for this: route the same image through the proprietary /v1/responses endpoint instead, using a distinct input_image field with raw base64 (no data: URI prefix). This works reliably but is undocumented as the required path for vision and isn't OpenAI-compatible, breaking drop-in compatibility with existing OpenAI client code.)

To reproduce

1. Construct a standard OpenAI Chat Completions request with an image supplied via the image_url content-part shape (as used by the official OpenAI SDK and every OpenAI-compatible client).

2. POST it to Foundry Local's /v1/chat/completions endpoint with the vision model loaded.

3. Observe the engine attempting a massive (tens-of-GB) memory allocation and crashing outright this takes down the whole service, not just the request.

4. Working alternative: route the same image through the proprietary /v1/responses endpoint instead, using a distinct input_image field with raw base64 (no data: URI prefix). This works reliably but is undocumented as the required path for vision and isn't OpenAI-compatible, breaking drop-in compatibility with existing OpenAI client code.

Urgency

Medium. Makes the standard/documented endpoint unusable for vision and forces consumers to use an undocumented, proprietary endpoint. But there is also a working alternative.

Platform and architecture

Windows X64

OS Version

Windows 11

Installation type

Released package/binary

Foundry Local version

0.10.2

API or surface area

REST API

Hardware acceleration/backend

CPU

Backend/runtime version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions