Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema export: publish config key to KV config field name mapping #253

Open
ncoghlan opened this issue Mar 4, 2025 · 0 comments
Open

Schema export: publish config key to KV config field name mapping #253

ncoghlan opened this issue Mar 4, 2025 · 0 comments

Comments

@ncoghlan
Copy link
Contributor

ncoghlan commented Mar 4, 2025

There are two essential formats for model and prediction configuration information:

  • the flat key-value types used at the SDK boundary (LlmPredictionConfig, LlmLoadModelConfig, EmbeddingLoadModelConfig)
  • the field listing based KvConfigStack format used in the LM Studio wire format

lmstudio-js defines the mapping between the two in https://github.com/lmstudio-ai/lmstudio-js/blob/main/packages/lms-kv-config/src/schema.ts

The lmstudio-js JSON schema export publishes both the SDK boundary types and the wire format types, but it doesn't publish the details of how to translate between them. Accordingly, lmstudio-python has to define its own duplicative mapping logic in https://github.com/lmstudio-ai/lmstudio-python/blob/main/src/lmstudio/_kv_config.py

This can lead to functionality lags, as the Python SDK may silently fail to translate defined-but-not-yet-implemented config settings from the SDK boundary formats to the wire config stack format.

Information which the Python SDK needs for each input key:

  • the mapped config stack field name for the setting (both the namespace prefix, and the key name itself, since the latter may differ from the input attribute/key name)
  • whether the value should be sent to the server as is, or if it should be nested as a checkbox subfield (that is, sent as {"key": server_config_name, "value": {"checked": True, "value": value}} rather than as just {"key": server_config_name, "value": value})

(corresponding lmstudio-python issue to consume the exported data file once it is available: lmstudio-ai/lmstudio-python#32

@ncoghlan ncoghlan changed the title Schema export: also publish config key to KV config field name mapping Schema export: publish config key to KV config field name mapping Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant