Skip to content

flm serve terminates in case of incorrect input instead of returning a response with an error #498

Closed

Description

@antrv
[⬇️ ]  Incoming Request: POST
[LOG]  Time stamp: 23:43:00 04:15:2026
[LOG]  Target: /v1/chat/completions
[LOG]  Version: 11
[LOG]  Keep-Alive: 1
[LOG]  Body:
{
    "messages": [
        {
            "content": "...",
            "role": "system"
        },
        {
            "content": [
                {
                    "text": "...",
                    "type": "text"
                },
                {
                    "image_url": {
                        "url": "data:image...ng;base64,"
                    },
                    "type": "image_url"
                }
            ],
            "role": "user"
        }
    ],
    "model": "gemma4-it:e2b"
}
[🟢 ]  NPU Locked!
[FLM]  Start prefill...
Error: Invalid base64 image payload
Attempting to resize to a 0 x 0 image.

FLM version 0.9.39

Activity

  1. twflm commented on Apr 16, 2026

    @twflm
    Contributor
    [⬇️ ]  Incoming Request: POST
    [LOG]  Time stamp: 23:43:00 04:15:2026
    [LOG]  Target: /v1/chat/completions
    [LOG]  Version: 11
    [LOG]  Keep-Alive: 1
    [LOG]  Body:
    {
        "messages": [
            {
                "content": "...",
                "role": "system"
            },
            {
                "content": [
                    {
                        "text": "...",
                        "type": "text"
                    },
                    {
                        "image_url": {
                            "url": "data:image...ng;base64,"
                        },
                        "type": "image_url"
                    }
                ],
                "role": "user"
            }
        ],
        "model": "gemma4-it:e2b"
    }
    [🟢 ]  NPU Locked!
    [FLM]  Start prefill...
    Error: Invalid base64 image payload
    Attempting to resize to a 0 x 0 image.
    

    FLM version 0.9.39

    was not able to reproduce it. Can you provide more info?

  2. assigned and unassigned on Apr 16, 2026
  3. antrv commented on Apr 17, 2026

    @antrv
    Author

    here is the exact request

    POST /v1/chat/completions
    Accept: application/json
    Content-Type: application/json
    Content-Length: 908
    User-Agent: OpenAI/2.10.0 (.NET 10.0.6; Microsoft Windows 10.0.26200)
    Authorization: flm
    
    {"messages":[{"role":"system","content":"You are a photo gallery assistant. You can exclusively generate descriptions of photographs or drawings with tags. The description must be in Russian language very detailed and contain the theme and style of the photograph or drawing, ongoing actions, main characters or objects. The description must include tags - preferably single words or at most phrases of maximum three words, which serve for searching the photograph or drawing. The list of tags must include, but not be limited to style, theme, action, characters and objects. The description must be in json format: {\"description\": \"description\", \"tags\": [\"tag1\", \"tag2\"] }. Do not use formatting or code blocks, only pure json."},{"role":"user","content":[{"type":"text","text":"Generate description."},{"type":"image_url","image_url":{"url":"data:image/jpeg;base64,"}}]}],"model":"gemma4-it:e2b"}
    
  4. antrv commented on Apr 17, 2026

    @antrv
    Author

    Also If I do a request with audio instead of image (in image_url field), flm serve terminates with error:

    Error: Unsupported image format (only JPEG/JPG and PNG supported)
    Attempting to resize to a 0 x 0 image.
    

    I think flm must return some error response, and keep serving the requests instead of termination.

  5. antrv commented on Apr 17, 2026

    @antrv
    Author

    I would rename the title of the issue to flm serve terminates in case of incorrect input instead of returning a response with an error

  6. ZaneNi commented on Apr 18, 2026

    @ZaneNi
    Contributor

    @antrv Thanks for reporting this. Yeah, the server shouldn't terminate on invalid input. We'll improve the error handling to return a proper response instead.

    Renaming the issue title also makes sense.

  7. changed the title [-]FLM server crashes if chat input contains empty image[/-] [+]flm serve terminates in case of incorrect input instead of returning a response with an error[/+] on Apr 18, 2026
  8. ZaneNi commented on Apr 21, 2026

    @ZaneNi
    Contributor

    @antrv Please take a look at this PR #507 and try the artifacts provided there.

  9. ZaneNi commented on May 10, 2026

    @ZaneNi
    Contributor

    Closing this issue. Feel free to reopen it if the issue persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions