Skip to content

Commit 5d31ad4

Browse files
authored
lmstudio.js repo has been renamed to lmstudio-js (#7)
(The previous name was automatically turned into an invalid hyperlink in a lot of different communication tools)
1 parent f7fa5ec commit 5d31ad4

File tree

10 files changed

+33
-33
lines changed

10 files changed

+33
-33
lines changed

.gitmodules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
[submodule "sdk-schema/lmstudio.js"]
2-
path = sdk-schema/lmstudio.js
3-
url = https://github.com/lmstudio-ai/lmstudio.js.git
1+
[submodule "sdk-schema/lmstudio-js"]
2+
path = sdk-schema/lmstudio-js
3+
url = https://github.com/lmstudio-ai/lmstudio-js.git

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ First off, thank you for considering contributing to our open source projects!
66

77
There are many ways to help, from writing tutorials or blog posts, improving the documentation, submitting bug reports and feature requests or contributing code which can be incorporated into the SDK itself.
88

9-
Note: the SDK documentation is maintained in combination with the [`lmstudio.js`](https://github.com/lmstudio-ai/lmstudio.js)
9+
Note: the SDK documentation is maintained in combination with [`lmstudio-js`](https://github.com/lmstudio-ai/lmstudio-js)
1010
in a dedicated [documentation repo](https://github.com/lmstudio-ai/docs).
1111

1212
## Communication
@@ -75,11 +75,11 @@ on working with the `lmstudio-python` code and test suite.
7575

7676
`lmstudio-python` communicates with LM Studio through its native dedicated websocket API, rather than via its Open AI compatibility layer.
7777

78-
- **How does `lmstudio-python` relate to `lmstudio.js`?**
78+
- **How does `lmstudio-python` relate to `lmstudio-js`?**
7979

80-
`lmstudio-python` communicates with LM Studio based on JSON interface types defined in `lmstudio.js`.
81-
The `lmstudio-python` repository includes `lmstudio.js` as a submodule in order to support generating
82-
the Python API interface classes from the JSON schema definitions exported by `lmstudio.js`.
80+
`lmstudio-python` communicates with LM Studio based on JSON interface types defined in `lmstudio-js`.
81+
The `lmstudio-python` repository includes `lmstudio-js` as a submodule in order to support generating
82+
the Python API interface classes from the JSON schema definitions exported by `lmstudio-js`.
8383

8484
## Questions
8585

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ $ cd lmstudio-python
6464
```
6565

6666
To be able to run `tox -e sync-sdk-schema`, it is also
67-
necessary to ensure the `lmstudio.js` submodule is updated:
67+
necessary to ensure the `lmstudio-js` submodule is updated:
6868

6969
```console
7070
$ git submodule update --init --recursive
@@ -193,10 +193,10 @@ Additional notes on running and updating the tests can be found in the
193193
- the content of `src/lmstudio/_sdk_models` is automatically generated by the
194194
`sync-sdk-schema.py` script in `sdk-schema` and should not be modified directly.
195195
Run `tox -e sync-sdk-schema` to regenerate the Python submodule from the existing
196-
export of the `lmstudio.js` schema (for example, after modifying the data model
196+
export of the `lmstudio-js` schema (for example, after modifying the data model
197197
template). Run `tox -e sync-sdk-schema -- --regen-schema` after updating the
198-
`sdk-schema/lmstudio.js` submodule itself to a newer iteration of the
199-
`lmstudio.js` JSON API.
198+
`sdk-schema/lmstudio-js` submodule itself to a newer iteration of the
199+
`lmstudio-js` JSON API.
200200
- as support for new API namespaces is added to the SDK, each should get a dedicated
201201
session type (similar to those for the already supported namespaces), even if it
202202
is only used privately by the client implementation.

sdk-schema/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
lmstudio.js JSON Schema export
1+
lmstudio-js JSON Schema export
22
==============================
33

44
`tox -e sync-sdk-schema` runs `sync-sdk-schema.py` in
55
a suitably configured Python environment.
66

7-
The generated models are written to `../src/lmstudio.js/_sdk_models/*.py`.
7+
The generated models are written to `../src/lmstudio/_sdk_models/*.py`.

sdk-schema/lmstudio-js

Submodule lmstudio-js added at 12af436

sdk-schema/lmstudio.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

sdk-schema/sync-sdk-schema.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python
2-
"""Generate Python data model classes from lmstudio.js zod schema.
2+
"""Generate Python data model classes from lmstudio-js zod schema.
33
44
Recreates the Python data model classes from the exported JSON schema
55
(generating the JSON schema only if necessary).
@@ -13,9 +13,9 @@
1313

1414

1515
# * invokes `npm run build` and `npm run make-schemas` in the
16-
# `lmstudio.js` submodule's `packages/lms-json-schema` project
16+
# `lmstudio-js` submodule's `packages/lms-json-schema` project
1717
# to create JSON schema files in
18-
# `./lmstudio.js/packages/lms-json-schema/schemas/lms.json`
18+
# `./lmstudio-js/packages/lms-json-schema/schemas/lms.json`
1919
# * uses `datamodel-code-generator` to produce Python data model
2020
# classes from the exported JSON schema files
2121

@@ -41,7 +41,7 @@
4141
)
4242

4343
_THIS_DIR = Path(__file__).parent
44-
_LMSJS_DIR = _THIS_DIR / "lmstudio.js"
44+
_LMSJS_DIR = _THIS_DIR / "lmstudio-js"
4545
_EXPORTER_DIR = _LMSJS_DIR / "packages/lms-json-schema"
4646
_SCHEMA_DIR = _EXPORTER_DIR / "schemas"
4747
_SCHEMA_PATH = _SCHEMA_DIR / "lms.json"
@@ -64,15 +64,15 @@
6464

6565
# TODO:
6666
# * Figure out a way to avoid the full clean-and-build
67-
# cycle when regenerating the lmstudio.js JSON schemas
67+
# cycle when regenerating the lmstudio-js JSON schemas
6868
#
6969
# * Potentially include models for the websocket channel,
7070
# rpc, and signal message formats:
71-
# https://github.com/lmstudio-ai/lmstudio.js/blob/main/packages/lms-communication/src/Transport.ts
71+
# https://github.com/lmstudio-ai/lmstudio-js/blob/main/packages/lms-communication/src/Transport.ts
7272

7373

7474
def _export_zod_schemas_to_json_schema() -> None:
75-
"""Run the lmstudio.js JSON schema export in the submodule."""
75+
"""Run the lmstudio-js JSON schema export in the submodule."""
7676
_SCHEMA_PATH.unlink(missing_ok=True)
7777
_CACHED_SCHEMA_PATH.unlink(missing_ok=True)
7878
with chdir(_LMSJS_DIR):
@@ -123,7 +123,7 @@ def _check_discriminator(tag_field: str, union_array: _SchemaList) -> bool:
123123
# Can only be a discriminated union on this tag if all variants have it
124124
return False
125125
if field_def["type"] != "string":
126-
# Only string based unions are defined in lmstudio.js
126+
# Only string based unions are defined in lmstudio-js
127127
return False
128128
tag_value = field_def.get("const", None)
129129
if tag_value is None:
@@ -251,7 +251,7 @@ def _extract_union_variants(
251251
def _is_void_union(union_members: _SchemaList) -> _SchemaObject | None:
252252
if len(union_members) != 2:
253253
return None
254-
# Note: the "void spec" definition is actually an error in the lmstudio.js
254+
# Note: the "void spec" definition is actually an error in the lmstudio-js
255255
# schema exporter, since it is defined as meaning "may be anything" in JSON
256256
# schema, but the exporter is wanting to specify "may be omitted entirely".
257257
# That "may be omitted" aspect would be specified by declaring the "result"

src/lmstudio/_kv_config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Conversion between dicts/public config structs and server KVConfig(Stack)s."""
22

33
# Known KV config settings are defined in
4-
# https://github.com/lmstudio-ai/lmstudio.js/blob/main/packages/lms-kv-config/src/schema.ts
4+
# https://github.com/lmstudio-ai/lmstudio-js/blob/main/packages/lms-kv-config/src/schema.ts
55
from typing import Any, Sequence, Type, TypeVar
66

77
from .sdk_api import LMStudioValueError
@@ -19,7 +19,7 @@
1919
LlmPredictionConfigDict,
2020
)
2121

22-
# TODO we can reasonably add unit tests for this module: compare against lmstudio.js?
22+
# TODO we can reasonably add unit tests for this module: compare against lmstudio-js?
2323

2424

2525
TLoadConfig = TypeVar("TLoadConfig", LlmLoadModelConfig, EmbeddingLoadModelConfig)
@@ -113,7 +113,7 @@ def _to_kv_config_stack_base(
113113
fields: list[KvConfigFieldDict] = []
114114
# TODO: Define a JSON or TOML data file for mapping prediction config
115115
# fields to config stack entries (preferably JSON exported by
116-
# lmstudio.js rather than something maintained in the Python SDK)
116+
# lmstudio-js rather than something maintained in the Python SDK)
117117

118118
for client_key in checkbox_keys:
119119
if client_key in config:

src/lmstudio/_sdk_models/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
lmstudio.js Pydantic Models
2-
===========================
1+
lmstudio-js SDK Data Model
2+
==========================
33

4-
The Pydantic model files in this folder are generated from the
5-
lmstudio.js zod schema files rather than being maintained directly.
4+
The Python data model class definitions in this folder are generated from
5+
the lmstudio-js zod schema files rather than being maintained directly.
66

77
These files should NOT be modified: if the messaging protocol details
8-
change, updates should be made in lmstudio.js first, and then exported
8+
change, updates should be made in lmstudio-js first, and then exported
99
to the Python SDK via the automated code generation.
1010

1111
See the `sdk-schema` exporter folder for additional details.

src/lmstudio/_sdk_models/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
22
# filename: lms-with-inferred-unions.json
3-
# timestamp: 2025-02-26T14:13:24+00:00
3+
# timestamp: 2025-02-27T03:57:00+00:00
44

55
from __future__ import annotations
66

0 commit comments

Comments
 (0)