llmsetup 0.4.0__tar.gz → 0.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. {llmsetup-0.4.0/src/llmsetup.egg-info → llmsetup-0.5.0}/PKG-INFO +89 -1
  2. {llmsetup-0.4.0 → llmsetup-0.5.0}/README.md +88 -0
  3. {llmsetup-0.4.0 → llmsetup-0.5.0}/pyproject.toml +1 -1
  4. llmsetup-0.5.0/src/llmsetup/catalog/hub.py +184 -0
  5. llmsetup-0.5.0/src/llmsetup/changes.py +301 -0
  6. llmsetup-0.5.0/src/llmsetup/chat.py +220 -0
  7. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/cli.py +337 -5
  8. llmsetup-0.5.0/src/llmsetup/connect.py +379 -0
  9. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/hardware/cpu.py +11 -7
  10. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/interop/jan.py +10 -1
  11. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/interop/lmstudio.py +11 -0
  12. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/interop/ollama.py +2 -0
  13. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/interop/openai_clients.py +36 -2
  14. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/interview/questions.py +1 -0
  15. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/pipeline.py +10 -1
  16. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/runtimes/llamacpp.py +4 -1
  17. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/runtimes/mlx.py +1 -0
  18. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/runtimes/vllm.py +1 -0
  19. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/server.py +35 -2
  20. llmsetup-0.5.0/src/llmsetup/tuning/overrides.py +112 -0
  21. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/types.py +1 -0
  22. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/util/fs.py +21 -1
  23. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/version.py +1 -1
  24. {llmsetup-0.4.0 → llmsetup-0.5.0/src/llmsetup.egg-info}/PKG-INFO +89 -1
  25. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup.egg-info/SOURCES.txt +12 -0
  26. llmsetup-0.5.0/tests/test_changes.py +184 -0
  27. llmsetup-0.5.0/tests/test_chat.py +219 -0
  28. llmsetup-0.5.0/tests/test_connect.py +175 -0
  29. llmsetup-0.5.0/tests/test_hub_models.py +131 -0
  30. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_module_entrypoint.py +1 -1
  31. llmsetup-0.5.0/tests/test_opencode_snippet.py +25 -0
  32. llmsetup-0.5.0/tests/test_overrides.py +85 -0
  33. llmsetup-0.5.0/tests/test_stop_waits_for_port.py +53 -0
  34. {llmsetup-0.4.0 → llmsetup-0.5.0}/LICENSE +0 -0
  35. {llmsetup-0.4.0 → llmsetup-0.5.0}/NOTICE +0 -0
  36. {llmsetup-0.4.0 → llmsetup-0.5.0}/setup.cfg +0 -0
  37. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/__main__.py +0 -0
  38. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/bench/__init__.py +0 -0
  39. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/bench/sweep.py +0 -0
  40. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/catalog/__init__.py +0 -0
  41. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/catalog/autoupdate.py +0 -0
  42. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/catalog/catalog.py +0 -0
  43. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/catalog/data/models.yaml +0 -0
  44. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/catalog/discover.py +0 -0
  45. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/catalog/refresh.py +0 -0
  46. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/download.py +0 -0
  47. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/gguf.py +0 -0
  48. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/hardware/__init__.py +0 -0
  49. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/hardware/bandwidth.py +0 -0
  50. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/hardware/detect.py +0 -0
  51. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/hardware/gpu.py +0 -0
  52. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/interop/__init__.py +0 -0
  53. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/interop/export.py +0 -0
  54. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/interop/llama_swap.py +0 -0
  55. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/interview/__init__.py +0 -0
  56. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/interview/wizard.py +0 -0
  57. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/launch.py +0 -0
  58. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/planner/__init__.py +0 -0
  59. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/planner/memory.py +0 -0
  60. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/planner/model_fit.py +0 -0
  61. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/planner/moe.py +0 -0
  62. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/planner/plan.py +0 -0
  63. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/planner/requested.py +0 -0
  64. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/planner/score.py +0 -0
  65. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/repair/__init__.py +0 -0
  66. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/repair/loop.py +0 -0
  67. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/repair/strategies.py +0 -0
  68. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/report/__init__.py +0 -0
  69. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/report/render.py +0 -0
  70. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/runtimes/__init__.py +0 -0
  71. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/runtimes/base.py +0 -0
  72. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/runtimes/capabilities.py +0 -0
  73. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/runtimes/data/llamacpp_flags.py +0 -0
  74. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/runtimes/dependencies.py +0 -0
  75. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/runtimes/gguf_store.py +0 -0
  76. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/runtimes/install.py +0 -0
  77. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/runtimes/lmstudio.py +0 -0
  78. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/runtimes/ollama.py +0 -0
  79. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/runtimes/registry.py +0 -0
  80. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/runtimes/tabby.py +0 -0
  81. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/tuning/__init__.py +0 -0
  82. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/tuning/advanced.py +0 -0
  83. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/tuning/platform_tuning.py +0 -0
  84. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/tuning/profiles.py +0 -0
  85. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/tuning/publisher.py +0 -0
  86. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/tuning/sampling.py +0 -0
  87. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/tuning/tuner.py +0 -0
  88. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/ui/__init__.py +0 -0
  89. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/ui/server.py +0 -0
  90. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/ui/static/index.html +0 -0
  91. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/util/__init__.py +0 -0
  92. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/util/errors.py +0 -0
  93. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/util/http.py +0 -0
  94. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/util/log.py +0 -0
  95. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/util/modelfile.py +0 -0
  96. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/util/proc.py +0 -0
  97. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/util/units.py +0 -0
  98. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/verify/__init__.py +0 -0
  99. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/verify/checks.py +0 -0
  100. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/verify/client.py +0 -0
  101. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/verify/harness.py +0 -0
  102. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup/verify/signatures.py +0 -0
  103. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup.egg-info/dependency_links.txt +0 -0
  104. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup.egg-info/entry_points.txt +0 -0
  105. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup.egg-info/requires.txt +0 -0
  106. {llmsetup-0.4.0 → llmsetup-0.5.0}/src/llmsetup.egg-info/top_level.txt +0 -0
  107. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_advanced_tuning.py +0 -0
  108. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_attention_and_drafting.py +0 -0
  109. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_auto_detection.py +0 -0
  110. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_auto_recovery.py +0 -0
  111. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_autoupdate.py +0 -0
  112. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_background_server.py +0 -0
  113. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_capabilities.py +0 -0
  114. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_catalog.py +0 -0
  115. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_catalog_boundaries.py +0 -0
  116. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_catalog_refresh.py +0 -0
  117. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_catalog_validation.py +0 -0
  118. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_cli.py +0 -0
  119. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_cli_inputs.py +0 -0
  120. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_context_profile.py +0 -0
  121. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_dense_offload.py +0 -0
  122. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_dependency_compatibility.py +0 -0
  123. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_download_integrity.py +0 -0
  124. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_embedding_setup.py +0 -0
  125. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_flag_coverage.py +0 -0
  126. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_forum_practice.py +0 -0
  127. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_gguf.py +0 -0
  128. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_gpu_detection.py +0 -0
  129. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_hybrid_attention.py +0 -0
  130. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_interop.py +0 -0
  131. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_interview.py +0 -0
  132. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_kv_quality.py +0 -0
  133. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_launch_failures.py +0 -0
  134. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_launch_matrix.py +0 -0
  135. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_memory.py +0 -0
  136. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_model_revisions.py +0 -0
  137. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_multigpu_and_apple.py +0 -0
  138. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_offline_integration.py +0 -0
  139. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_ollama.py +0 -0
  140. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_ollama_live.py +0 -0
  141. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_plan_reporting.py +0 -0
  142. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_planner.py +0 -0
  143. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_prefill.py +0 -0
  144. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_release_script.py +0 -0
  145. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_repair.py +0 -0
  146. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_repair_provisioning.py +0 -0
  147. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_reproducibility.py +0 -0
  148. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_requested_model_planner.py +0 -0
  149. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_research_config.py +0 -0
  150. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_runtime_dependencies.py +0 -0
  151. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_runtime_install.py +0 -0
  152. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_security.py +0 -0
  153. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_server_logs.py +0 -0
  154. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_setups.py +0 -0
  155. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_specific_model_interview.py +0 -0
  156. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_specific_model_recovery.py +0 -0
  157. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_specific_model_tuning.py +0 -0
  158. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_start.py +0 -0
  159. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_startup_recovery.py +0 -0
  160. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_sweep.py +0 -0
  161. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_tool_parsers.py +0 -0
  162. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_tuner.py +0 -0
  163. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_ui.py +0 -0
  164. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_verification_integrity.py +0 -0
  165. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_verify.py +0 -0
  166. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_vision.py +0 -0
  167. {llmsetup-0.4.0 → llmsetup-0.5.0}/tests/test_vllm_kv.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: llmsetup
3
- Version: 0.4.0
3
+ Version: 0.5.0
4
4
  Summary: Interview-driven setup assistant for local open-weight LLMs: picks the model, tunes the runtime, proves it works, and registers it with every local LLM app you use.
5
5
  License-Expression: Apache-2.0
6
6
  Project-URL: Homepage, https://github.com/catfish-1234/llmsetup
@@ -111,6 +111,10 @@ llmsetup status
111
111
  llmsetup logs --follow
112
112
  llmsetup restart
113
113
  llmsetup stop
114
+
115
+ # Talk to the verified model, or ask it one question.
116
+ llmsetup chat
117
+ llmsetup chat -m "Write a haiku about VRAM"
114
118
  ```
115
119
 
116
120
  `--task` is repeatable, for example `--task coding --task agent`. `--context`
@@ -172,6 +176,90 @@ it shows the endpoint, since their daemons serve the model on demand. Only a
172
176
  setup whose checks passed can be started this way; after changing anything,
173
177
  run `llmsetup doctor`. Generated client snippets need a running endpoint.
174
178
 
179
+ `llmsetup chat` talks to the model in the terminal: the background server if
180
+ one is running, otherwise the last verified setup's endpoint, which has to be
181
+ answering (`llmsetup start --detach` first). Replies stream as they are
182
+ generated and are printed inert, like the log. `/reset` starts the conversation
183
+ over, `/exit` or Ctrl-D leaves, and Ctrl-C stops a reply without ending the
184
+ session. `-m "..."` asks one question and exits (`-m -` reads it from stdin,
185
+ `--json` prints `{"model", "base_url", "reply"}`), `--system` sets a system
186
+ prompt, and `--thinking` also shows the thinking a reasoning model streams
187
+ separately. `--base-url` and `--model` point it at any other
188
+ OpenAI-compatible server, with `--api-key` for one that needs a token.
189
+
190
+ ## Any model, any setting, any tool, and undo
191
+
192
+ The catalog is what llmsetup recommends. It does not limit what you can run:
193
+
194
+ ```bash
195
+ # Any GGUF repo on Hugging Face; architecture comes from its config or its base model.
196
+ llmsetup setup --model hf:bartowski/SomeModel-GGUF
197
+
198
+ # A derivative of a catalog model, found on Hugging Face: abliterated (or heretic,
199
+ # uncensored, or any other name), a fine-tune, a merge.
200
+ llmsetup setup --model qwen3-8b --variant abliterated
201
+
202
+ # Override anything the tuner chose, and pass flags straight to the engine.
203
+ llmsetup settings # what --set can change
204
+ llmsetup setup --set context_tokens=32768 --set flash_attention=true --set kv_cache_type=q8_0 --engine-arg=--no-warmup
205
+ ```
206
+
207
+ `--model hf:` and `--variant` add an ordinary entry to your overlay catalog
208
+ (`catalog.d/hub.yaml` in the data directory), so the model is planned, fitted
209
+ and verified like any other. A variant keeps its base model's architecture,
210
+ which a fine-tune or abliteration does not change, so its memory plan is as
211
+ exact as the base's, and it never falls back to the base's own Ollama tag or
212
+ weights. Discovery still never *recommends* a decensored model; `--variant` is
213
+ how you ask for one. Read the variant's model card: its behaviour and licence
214
+ terms are its publisher's. `--set` takes any runtime setting (`llmsetup
215
+ settings` lists them with their types) and is applied after tuning and before
216
+ verification, so what is verified, saved and restarted is what you asked for;
217
+ `--no-repair` keeps your values exactly instead of letting repair adjust one
218
+ that fails. `--engine-arg` reaches llama.cpp, vLLM and MLX as given. Setting
219
+ `host` beyond loopback is called out, since anyone who can reach the machine
220
+ can then use the model.
221
+
222
+ `llmsetup connect` writes the verified model into another tool's own config
223
+ instead of leaving a snippet to paste:
224
+
225
+ ```bash
226
+ llmsetup connect --list # the tools it knows, and the file it edits for each
227
+ llmsetup connect opencode --default
228
+ llmsetup connect continue
229
+ llmsetup connect aider --project
230
+ llmsetup connect zed --dry-run # print the result, change nothing
231
+ llmsetup connect claude-code # the launch command; --project writes .claude/settings.local.json
232
+ llmsetup connect codex # the ~/.codex/config.toml provider and profile
233
+ ```
234
+
235
+ It merges an llmsetup entry and keeps everything else in the file, replaces
236
+ only what it added before, and leaves a config that has comments alone (with
237
+ the snippet printed) unless you pass `--rewrite`, since rewriting JSON or YAML
238
+ loses them. Open WebUI and Cursor are set up in their own screens, so `connect`
239
+ prints the steps. Claude Code needs a server that speaks the Anthropic Messages
240
+ API (llama.cpp from January 2026, Ollama, LM Studio 0.4.1 or later) and its
241
+ prompts need at least 32K tokens of context; `connect claude-code` prints the
242
+ per-launch command, and writes settings only for one project with `--project`,
243
+ since the user-wide file would send every Claude Code session to the local
244
+ model. Codex speaks only the Responses API, and some local servers reject the
245
+ tools recent releases send, so `connect codex` prints its config with that
246
+ caveat rather than writing it.
247
+
248
+ Everything llmsetup changes outside its own directory is recorded: links in
249
+ LM Studio's and Jan's model folders, Jan's `model.json`, Ollama tags, and every
250
+ config `connect` writes (with a copy of the file as it was). Undo is one
251
+ command:
252
+
253
+ ```bash
254
+ llmsetup changes # what each run changed
255
+ llmsetup undo # reverse the newest run
256
+ llmsetup undo --run <id> # or one run, or --all; --dry-run previews
257
+ ```
258
+
259
+ Undo removes or restores a file only while it is still what llmsetup left;
260
+ a file edited since is reported and kept, unless `--force`. Downloaded weights
261
+ stay in the shared store; they are llmsetup's own files, not a change to undo.
262
+
175
263
  ## Other commands
176
264
 
177
265
  ```bash
@@ -78,6 +78,10 @@ llmsetup status
78
78
  llmsetup logs --follow
79
79
  llmsetup restart
80
80
  llmsetup stop
81
+
82
+ # Talk to the verified model, or ask it one question.
83
+ llmsetup chat
84
+ llmsetup chat -m "Write a haiku about VRAM"
81
85
  ```
82
86
 
83
87
  `--task` is repeatable, for example `--task coding --task agent`. `--context`
@@ -139,6 +143,90 @@ it shows the endpoint, since their daemons serve the model on demand. Only a
139
143
  setup whose checks passed can be started this way; after changing anything,
140
144
  run `llmsetup doctor`. Generated client snippets need a running endpoint.
141
145
 
146
+ `llmsetup chat` talks to the model in the terminal: the background server if
147
+ one is running, otherwise the last verified setup's endpoint, which has to be
148
+ answering (`llmsetup start --detach` first). Replies stream as they are
149
+ generated and are printed inert, like the log. `/reset` starts the conversation
150
+ over, `/exit` or Ctrl-D leaves, and Ctrl-C stops a reply without ending the
151
+ session. `-m "..."` asks one question and exits (`-m -` reads it from stdin,
152
+ `--json` prints `{"model", "base_url", "reply"}`), `--system` sets a system
153
+ prompt, and `--thinking` also shows the thinking a reasoning model streams
154
+ separately. `--base-url` and `--model` point it at any other
155
+ OpenAI-compatible server, with `--api-key` for one that needs a token.
156
+
157
+ ## Any model, any setting, any tool, and undo
158
+
159
+ The catalog is what llmsetup recommends. It does not limit what you can run:
160
+
161
+ ```bash
162
+ # Any GGUF repo on Hugging Face; architecture comes from its config or its base model.
163
+ llmsetup setup --model hf:bartowski/SomeModel-GGUF
164
+
165
+ # A derivative of a catalog model, found on Hugging Face: abliterated (or heretic,
166
+ # uncensored, or any other name), a fine-tune, a merge.
167
+ llmsetup setup --model qwen3-8b --variant abliterated
168
+
169
+ # Override anything the tuner chose, and pass flags straight to the engine.
170
+ llmsetup settings # what --set can change
171
+ llmsetup setup --set context_tokens=32768 --set flash_attention=true --set kv_cache_type=q8_0 --engine-arg=--no-warmup
172
+ ```
173
+
174
+ `--model hf:` and `--variant` add an ordinary entry to your overlay catalog
175
+ (`catalog.d/hub.yaml` in the data directory), so the model is planned, fitted
176
+ and verified like any other. A variant keeps its base model's architecture,
177
+ which a fine-tune or abliteration does not change, so its memory plan is as
178
+ exact as the base's, and it never falls back to the base's own Ollama tag or
179
+ weights. Discovery still never *recommends* a decensored model; `--variant` is
180
+ how you ask for one. Read the variant's model card: its behaviour and licence
181
+ terms are its publisher's. `--set` takes any runtime setting (`llmsetup
182
+ settings` lists them with their types) and is applied after tuning and before
183
+ verification, so what is verified, saved and restarted is what you asked for;
184
+ `--no-repair` keeps your values exactly instead of letting repair adjust one
185
+ that fails. `--engine-arg` reaches llama.cpp, vLLM and MLX as given. Setting
186
+ `host` beyond loopback is called out, since anyone who can reach the machine
187
+ can then use the model.
188
+
189
+ `llmsetup connect` writes the verified model into another tool's own config
190
+ instead of leaving a snippet to paste:
191
+
192
+ ```bash
193
+ llmsetup connect --list # the tools it knows, and the file it edits for each
194
+ llmsetup connect opencode --default
195
+ llmsetup connect continue
196
+ llmsetup connect aider --project
197
+ llmsetup connect zed --dry-run # print the result, change nothing
198
+ llmsetup connect claude-code # the launch command; --project writes .claude/settings.local.json
199
+ llmsetup connect codex # the ~/.codex/config.toml provider and profile
200
+ ```
201
+
202
+ It merges an llmsetup entry and keeps everything else in the file, replaces
203
+ only what it added before, and leaves a config that has comments alone (with
204
+ the snippet printed) unless you pass `--rewrite`, since rewriting JSON or YAML
205
+ loses them. Open WebUI and Cursor are set up in their own screens, so `connect`
206
+ prints the steps. Claude Code needs a server that speaks the Anthropic Messages
207
+ API (llama.cpp from January 2026, Ollama, LM Studio 0.4.1 or later) and its
208
+ prompts need at least 32K tokens of context; `connect claude-code` prints the
209
+ per-launch command, and writes settings only for one project with `--project`,
210
+ since the user-wide file would send every Claude Code session to the local
211
+ model. Codex speaks only the Responses API, and some local servers reject the
212
+ tools recent releases send, so `connect codex` prints its config with that
213
+ caveat rather than writing it.
214
+
215
+ Everything llmsetup changes outside its own directory is recorded: links in
216
+ LM Studio's and Jan's model folders, Jan's `model.json`, Ollama tags, and every
217
+ config `connect` writes (with a copy of the file as it was). Undo is one
218
+ command:
219
+
220
+ ```bash
221
+ llmsetup changes # what each run changed
222
+ llmsetup undo # reverse the newest run
223
+ llmsetup undo --run <id> # or one run, or --all; --dry-run previews
224
+ ```
225
+
226
+ Undo removes or restores a file only while it is still what llmsetup left;
227
+ a file edited since is reported and kept, unless `--force`. Downloaded weights
228
+ stay in the shared store; they are llmsetup's own files, not a change to undo.
229
+
142
230
  ## Other commands
143
231
 
144
232
  ```bash
@@ -11,7 +11,7 @@ build-backend = "setuptools.build_meta"
11
11
 
12
12
  [project]
13
13
  name = "llmsetup"
14
- version = "0.4.0"
14
+ version = "0.5.0"
15
15
  description = "Interview-driven setup assistant for local open-weight LLMs: picks the model, tunes the runtime, proves it works, and registers it with every local LLM app you use."
16
16
  readme = "README.md"
17
17
  requires-python = ">=3.9"
@@ -0,0 +1,184 @@
1
+ """Any Hugging Face GGUF repo, or a named variant of a catalog model, as a catalog entry.
2
+
3
+ The bundled catalog is curated: it is what llmsetup recommends. Some people want a model it does
4
+ not list: a fine-tune, a quantization from a publisher they trust, or a decensored ("abliterated")
5
+ derivative, which discovery deliberately never recommends to someone who did not ask for one.
6
+ These are the ways to ask:
7
+
8
+ llmsetup setup --model hf:bartowski/SomeModel-GGUF
9
+ llmsetup setup --model qwen3-8b --variant abliterated
10
+
11
+ Either way the result is an ordinary entry in your overlay catalog ($LLMSETUP_HOME/catalog.d),
12
+ planned, fitted and verified like every other model. A variant keeps its base model's
13
+ architecture, which a fine-tune or abliteration does not change, so its memory plan is as exact
14
+ as the base's, and it drops every pointer to the base's own weights (its Ollama tag, its
15
+ safetensors and MLX repos), so nothing can quietly serve the original under the variant's name.
16
+ A repo of unknown lineage takes its architecture from its own config.json or its base model's;
17
+ without either the plan is marked estimated, and the GGUF header corrects it once downloaded.
18
+ """
19
+
20
+ from __future__ import annotations
21
+
22
+ import re
23
+ import urllib.parse
24
+ from dataclasses import asdict
25
+ from typing import Any, Callable, Dict, List, Optional
26
+
27
+ from llmsetup.catalog.discover import (
28
+ _QUANT_RE,
29
+ _get_json,
30
+ _license_of,
31
+ _likely_tools,
32
+ _tasks_for,
33
+ active_params_from_name,
34
+ architecture_from_config,
35
+ fetch_config,
36
+ params_from_metadata,
37
+ slug_for,
38
+ )
39
+ from llmsetup.download import HF_ENDPOINT, is_projector, validate_repo
40
+ from llmsetup.types import ModelSpec
41
+ from llmsetup.util.errors import CatalogError
42
+
43
+ GetJson = Callable[..., Optional[Any]]
44
+
45
+ #: Names a technique goes by. Abliteration is now mostly published as "heretic".
46
+ VARIANT_ALIASES: Dict[str, tuple] = {
47
+ "abliterated": ("abliterated", "heretic"),
48
+ "heretic": ("heretic", "abliterated"),
49
+ "uncensored": ("uncensored", "abliterated", "heretic"),
50
+ }
51
+
52
+ #: Fields that point at a model's weights; a variant replaces them all with its own GGUF repo.
53
+ SOURCE_FIELDS = ("ollama_name", "hf_repo", "mlx_repo", "gguf_revision", "hf_revision", "mlx_revision")
54
+
55
+
56
+ def parse_hub_ref(value: str) -> Optional[str]:
57
+ """``owner/repo`` from ``hf:owner/repo`` or a huggingface.co URL; None for anything else."""
58
+ text = value.strip()
59
+ match = re.match(r"^(?:hf:|(?:https?://)?(?:www\.)?huggingface\.co/)([\w.-]+/[\w.-]+)(?:/.*)?$", text)
60
+ return match.group(1) if match else None
61
+
62
+
63
+ def _norm(text: str) -> str:
64
+ return re.sub(r"[^a-z0-9]", "", text.lower())
65
+
66
+
67
+ def _repo_files(repo: str, get_json: GetJson) -> Optional[Dict[str, Any]]:
68
+ info = get_json(f"{HF_ENDPOINT}/api/models/{urllib.parse.quote(repo, safe='/')}")
69
+ return info if isinstance(info, dict) else None
70
+
71
+
72
+ def _gguf_facts(info: Dict[str, Any]) -> Dict[str, Any]:
73
+ """Quantizations published, and whether a vision projector ships beside them."""
74
+ names = [str(s.get("rfilename") or "") for s in info.get("siblings") or []]
75
+ ggufs = [n for n in names if n.lower().endswith(".gguf")]
76
+ quants = sorted({m.group(1) for n in ggufs if not is_projector(n) for m in [_QUANT_RE.search(n)] if m})
77
+ return {"quants": quants, "projector": any(is_projector(n) for n in ggufs), "has_gguf": bool(ggufs)}
78
+
79
+
80
+ def find_variants(spec: ModelSpec, keyword: str, *, get_json: GetJson = _get_json,
81
+ check: int = 5) -> List[Dict[str, Any]]:
82
+ """GGUF repos of ``keyword`` derivatives of ``spec``, most downloaded first.
83
+
84
+ A candidate must name the base model (so a different size of the same family is not taken
85
+ for it), carry one of the keyword's names, and publish GGUF quantizations.
86
+ """
87
+ base = (spec.hf_repo or spec.gguf_repo or spec.id).split("/")[-1]
88
+ base = re.sub(r"(?i)[-_.]gguf$", "", base)
89
+ base_key = _norm(base)
90
+ terms = VARIANT_ALIASES.get(keyword.lower(), (keyword.lower(),))
91
+
92
+ seen: Dict[str, Dict[str, Any]] = {}
93
+ for search in [base, *(f"{base}-{term}" for term in terms)]:
94
+ query = urllib.parse.urlencode({"search": search, "filter": "gguf", "sort": "downloads",
95
+ "direction": "-1", "limit": "100"})
96
+ for item in get_json(f"{HF_ENDPOINT}/api/models?{query}") or []:
97
+ repo = str(item.get("id") or item.get("modelId") or "")
98
+ lowered = repo.lower()
99
+ if not repo or repo in seen or base_key not in _norm(repo.split("/")[-1]):
100
+ continue
101
+ if not any(term in lowered for term in terms):
102
+ continue
103
+ seen[repo] = {"repo": repo, "downloads": int(item.get("downloads") or 0),
104
+ "likes": int(item.get("likes") or 0)}
105
+
106
+ ranked = sorted(seen.values(), key=lambda c: (c["downloads"], c["likes"]), reverse=True)
107
+ usable = []
108
+ for candidate in ranked[:check]:
109
+ info = _repo_files(candidate["repo"], get_json)
110
+ facts = _gguf_facts(info) if info else None
111
+ if facts and facts["quants"]:
112
+ usable.append({**candidate, **facts})
113
+ return usable
114
+
115
+
116
+ def variant_entry(spec: ModelSpec, keyword: str, candidate: Dict[str, Any]) -> Dict[str, Any]:
117
+ """The catalog entry for one variant: the base's architecture, the variant's weights."""
118
+ entry = {k: v for k, v in asdict(spec).items() if v is not None and k not in SOURCE_FIELDS}
119
+ published = list(candidate["quants"])
120
+ preferred = [q for q in spec.recommended_quants if q in published]
121
+ entry.update({
122
+ "id": f"{spec.id}-{_norm(keyword)}",
123
+ "name": f"{spec.name} ({keyword})",
124
+ "publisher": candidate["repo"].split("/")[0],
125
+ "gguf_repo": candidate["repo"],
126
+ "recommended_quants": preferred or published[:4],
127
+ # A repo without a projector serves the language model only.
128
+ "supports_vision": bool(spec.supports_vision and candidate.get("projector")),
129
+ "notes": (f"{keyword} derivative of {spec.name} from {candidate['repo']}, chosen explicitly "
130
+ f"with --variant. Same architecture as {spec.id}; its behaviour and licence terms "
131
+ f"are the publisher's, so read the model card."),
132
+ })
133
+ return entry
134
+
135
+
136
+ def repo_entry(repo: str, *, get_json: GetJson = _get_json,
137
+ config_for: Callable[[str], Optional[Dict[str, Any]]] = fetch_config) -> Dict[str, Any]:
138
+ """The catalog entry for an arbitrary Hugging Face GGUF repo."""
139
+ repo = validate_repo(repo)
140
+ info = _repo_files(repo, get_json)
141
+ if info is None:
142
+ raise CatalogError(f"could not read {repo} from Hugging Face",
143
+ hint="check the name, your network, and HF_TOKEN for a gated repo")
144
+ facts = _gguf_facts(info)
145
+ if not facts["has_gguf"]:
146
+ raise CatalogError(f"{repo} publishes no GGUF files, which llmsetup needs",
147
+ hint="look for a GGUF conversion of it (repos usually ending in -GGUF)")
148
+ card = info.get("cardData") or {}
149
+ bases = card.get("base_model") or []
150
+ first = bases[0] if isinstance(bases, list) and bases else bases
151
+ base: Optional[str] = first if isinstance(first, str) and first else None
152
+
153
+ config = config_for(repo) or (config_for(base) if base else None)
154
+ arch = architecture_from_config(config) if config else None
155
+ base_info = _repo_files(base, get_json) if base else None
156
+ params = params_from_metadata(info, repo)
157
+ if params is None and base_info is not None and base:
158
+ params = params_from_metadata(base_info, str(base))
159
+ if params is None:
160
+ raise CatalogError(f"cannot tell how large {repo} is",
161
+ hint=f"add it with `llmsetup catalog add <id> --gguf-repo {repo} --params <billions>`")
162
+ tags = [str(t) for t in info.get("tags") or []]
163
+ entry: Dict[str, Any] = {
164
+ "id": slug_for(repo),
165
+ "name": repo.split("/")[-1],
166
+ "publisher": repo.split("/")[0],
167
+ "params_b": round(float(params), 3),
168
+ "license": _license_of(info),
169
+ "tasks": _tasks_for(repo, tags, bool(arch and arch.get("vision"))),
170
+ "supports_tools": _likely_tools(repo, tags),
171
+ "supports_vision": bool(arch and arch.get("vision") and facts["projector"]),
172
+ "gguf_repo": repo,
173
+ "recommended_quants": [q for q in ("Q4_K_M", "Q5_K_M", "Q6_K", "Q8_0") if q in facts["quants"]]
174
+ or facts["quants"][:4],
175
+ "arch_source": "measured" if arch else "estimated",
176
+ "notes": (f"Added from {repo} with --model hf:{repo}."
177
+ + ("" if arch else " Architecture is estimated until the GGUF header is read on download.")),
178
+ }
179
+ active = active_params_from_name(repo)
180
+ if active:
181
+ entry["active_params_b"] = active
182
+ if arch:
183
+ entry.update({k: arch[k] for k in ("layers", "hidden_size", "kv_heads", "head_dim", "max_context")})
184
+ return entry