Skip to content

On-demand loading via API loads multiple instances of the same model #1751

Description

@jwr

Which version of LM Studio?
Version 0.4.9+1 (0.4.9+1)

Which operating system?
macOS

What is the bug?
With just-in-time model loading enabled, if several requests come in for the same model within a short period of time, multiple instances of the model will be started. In my specific case, I use a parallelism factor of four, so four instances are loaded, even though only one will be doing actual work on four requests at a time. The "only keep last JIT loaded model" option has no effect.

If I load the model manually, or if I eject the additional instances, things work as expected — until the next time several requests arrive and no model is loaded.

This looks like a race condition.

To Reproduce
Steps to reproduce the behavior:

  1. Send several requests in a short period of time when no model is loaded and just-in-time model loading is enabled.
  2. Observe several instances of the model being started.

Metadata

Metadata

Assignees

No one assigned

    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