tenseleyflow/documentlanguagemodel / bdc969f

Browse files

README + CHANGELOG: dlm export --emit-sway-json (S26 X1-P6)

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
bdc969f9c3bb3ab3a7ead6bba1d5c84f361271cd
Parents
ec6f384
Tree
1de4fc6

2 changed files

StatusFile+-
M CHANGELOG.md 20 0
M README.md 5 0
CHANGELOG.mdmodified
@@ -28,6 +28,26 @@ the project targets [Semantic Versioning](https://semver.org/).
2828
 
2929
 ### Added
3030
 
31
+- **`dlm export --emit-sway-json`** writes a ready-to-run
32
+  `<export-dir>/sway.yaml` alongside the GGUF/Modelfile, eliminating
33
+  the previous two-step `dlm export` → `sway autogen` ritual users
34
+  had to do before evaluating an adapter via [sway](https://github.com/tenseleyFlow/sway).
35
+  Calls into `dlm_sway.integrations.dlm.autogen.build_spec_dict` via
36
+  a new `dlm.export.sway_json.write_sway_json` helper. Closes the X1
37
+  half of sway's Sprint 26 cross-repo integration; X3 (sway-side
38
+  `sway pack` / `sway unpack`) ships in sway proper.
39
+  - New `[sway]` optional extra (`pip install 'dlm[sway]'`) pulls
40
+    `dlm-sway>=0.1.0`. Deliberately pulls plain `dlm-sway`, NOT
41
+    `dlm-sway[dlm]`, because the round-trip extra would create a
42
+    pip-resolver cycle (sway's `[dlm]` extra already pulls dlm).
43
+  - Failures route through a new typed `SwayJsonExportError`
44
+    (subclass of `ExportError`) so the CLI's existing exception
45
+    handler renders them cleanly. The most common failure — user
46
+    didn't install the `[sway]` extra — gets a message that names
47
+    the install command verbatim.
48
+  - 5 unit tests in `tests/unit/cli/test_export_sway_json.py`
49
+    cover the helper round-trip, missing-extra error, autogen
50
+    failure wrapping, and CLI flag wiring.
3151
 - **`dlm train --skip-export-probes`** mirrors the flag on `dlm init`
3252
   (it was missing from the train CLI; a user could `dlm init
3353
   --skip-export-probes` a fresh .dlm then have `dlm train` re-run
README.mdmodified
@@ -290,6 +290,11 @@ uv run dlm export mydoc.dlm --target vllm
290290
 uv run dlm export mydoc.dlm --target mlx-serve
291291
 uv run dlm pack mydoc.dlm --include-exports
292292
 uv run dlm verify mydoc.dlm.pack
293
+
294
+# Also emit a ready-to-run sway.yaml next to the GGUF for downstream
295
+# evaluation via `sway run` (requires the [sway] extra).
296
+uv run dlm export mydoc.dlm --target ollama --emit-sway-json
297
+uv run sway run <export-dir>/sway.yaml
293298
 ```
294299
 
295300
 On Apple Silicon, `--target vllm` now emits conservative `vllm-metal`