feat(lm-studio): add native model discovery and capability detection - #1652
feat(lm-studio): add native model discovery and capability detection#1652AnishSarkar22 wants to merge 9 commits into
Conversation
…ce error handling for connection verification
…update registry entry for LM Studio
…ry and error handling
…odel capability checks
…nse handling to check for 'models' key in payload
… in tests to align with updated API structure
|
@AnishSarkar22 is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…odel discovery by raising ModelDiscoveryError with specific upgrade instructions
…e assertions to reflect error handling for unavailable native APIs
…ery failure by simplifying detail output
Description
/api/v1/modelsendpoint.Motivation and Context
FIX #
Screenshots
API Changes
Change Type
Testing Performed
Checklist
High-level PR Summary
This PR implements a custom model discovery mechanism for LM Studio connections by adding support for LM Studio's native API endpoints (
/api/v1/modelsand/api/v0/models) with fallback to OpenAI-compatible discovery. The changes include a new discovery strategy in the provider registry, comprehensive parsing logic for LM Studio's model metadata including capabilities like vision and tool support, robust error handling, and a frontend capability override mechanism to respect user-defined model capabilities.⏱️ Estimated Review Time: 15-30 minutes
💡 Review Order Suggestion
surfsense_backend/app/services/provider_registry.pysurfsense_backend/app/services/model_connection_service.pysurfsense_backend/tests/unit/services/test_lm_studio_discovery.pysurfsense_web/components/settings/model-connections/model-utils.ts