Add LM Studio support to the Assistant (#23097)

#### Release Notes:

- Added support for [LM Studio](https://lmstudio.ai/) to the Assistant.

#### Quick demo:


https://github.com/user-attachments/assets/af58fc13-1abc-4898-9747-3511016da86a

#### Future enhancements:
- wire up tool calling (new in [LM Studio
0.3.6](https://lmstudio.ai/blog/lmstudio-v0.3.6))

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
This commit is contained in:
Yagil Burowski 2025-01-14 15:41:58 -05:00 committed by GitHub
parent 4445679f3c
commit c038696aa8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 1153 additions and 2 deletions

View file

@ -28,6 +28,7 @@ image.workspace = true
log.workspace = true
ollama = { workspace = true, features = ["schemars"] }
open_ai = { workspace = true, features = ["schemars"] }
lmstudio = { workspace = true, features = ["schemars"] }
parking_lot.workspace = true
proto.workspace = true
schemars.workspace = true

View file

@ -2,5 +2,6 @@ pub mod cloud_model;
pub use anthropic::Model as AnthropicModel;
pub use cloud_model::*;
pub use lmstudio::Model as LmStudioModel;
pub use ollama::Model as OllamaModel;
pub use open_ai::Model as OpenAiModel;

View file

@ -65,3 +65,13 @@ impl From<Role> for open_ai::Role {
}
}
}
impl From<Role> for lmstudio::Role {
fn from(val: Role) -> Self {
match val {
Role::User => lmstudio::Role::User,
Role::Assistant => lmstudio::Role::Assistant,
Role::System => lmstudio::Role::System,
}
}
}