lemonmatrix 0.1.0__py3-none-any.whl
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.
- lemonmatrix/__init__.py +8 -0
- lemonmatrix/backend_version.py +70 -0
- lemonmatrix/bench.py +2158 -0
- lemonmatrix/capabilities.py +320 -0
- lemonmatrix/cli.py +2127 -0
- lemonmatrix/client.py +545 -0
- lemonmatrix/discover.py +61 -0
- lemonmatrix/importers.py +233 -0
- lemonmatrix/profile.py +284 -0
- lemonmatrix/prompt_sets.py +52 -0
- lemonmatrix/results_store.py +540 -0
- lemonmatrix/routing_cost.py +179 -0
- lemonmatrix/schema/audiogen_result.schema.json +103 -0
- lemonmatrix/schema/classify_result.schema.json +101 -0
- lemonmatrix/schema/embeddings_result.schema.json +102 -0
- lemonmatrix/schema/imagegen_result.schema.json +106 -0
- lemonmatrix/schema/imported_result.schema.json +89 -0
- lemonmatrix/schema/meshgen_result.schema.json +103 -0
- lemonmatrix/schema/rerank_result.schema.json +101 -0
- lemonmatrix/schema/result.schema.json +202 -0
- lemonmatrix/schema/stt_result.schema.json +101 -0
- lemonmatrix/schema/tts_result.schema.json +103 -0
- lemonmatrix/static/dashboard.css +217 -0
- lemonmatrix/submit.py +129 -0
- lemonmatrix/sweep_batch.py +188 -0
- lemonmatrix/sweep_store.py +148 -0
- lemonmatrix/templates/audiogen.html +114 -0
- lemonmatrix/templates/base.html +25 -0
- lemonmatrix/templates/classify.html +112 -0
- lemonmatrix/templates/downloads.html +71 -0
- lemonmatrix/templates/embeddings.html +115 -0
- lemonmatrix/templates/failures.html +33 -0
- lemonmatrix/templates/imagegen.html +116 -0
- lemonmatrix/templates/imported.html +52 -0
- lemonmatrix/templates/index.html +145 -0
- lemonmatrix/templates/meshgen.html +140 -0
- lemonmatrix/templates/models_add.html +84 -0
- lemonmatrix/templates/profile_debug.html +27 -0
- lemonmatrix/templates/profile_detail.html +155 -0
- lemonmatrix/templates/profiles.html +96 -0
- lemonmatrix/templates/queue.html +327 -0
- lemonmatrix/templates/rerank.html +122 -0
- lemonmatrix/templates/result_detail.html +74 -0
- lemonmatrix/templates/run_form.html +279 -0
- lemonmatrix/templates/stt.html +114 -0
- lemonmatrix/templates/sweep_form.html +281 -0
- lemonmatrix/templates/sweep_status.html +62 -0
- lemonmatrix/templates/trials_detail.html +18 -0
- lemonmatrix/templates/tts.html +114 -0
- lemonmatrix/validate.py +163 -0
- lemonmatrix/webapp.py +1880 -0
- lemonmatrix-0.1.0.dist-info/METADATA +169 -0
- lemonmatrix-0.1.0.dist-info/RECORD +57 -0
- lemonmatrix-0.1.0.dist-info/WHEEL +5 -0
- lemonmatrix-0.1.0.dist-info/entry_points.txt +2 -0
- lemonmatrix-0.1.0.dist-info/licenses/LICENSE +201 -0
- lemonmatrix-0.1.0.dist-info/top_level.txt +1 -0
lemonmatrix/__init__.py
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"""Looks up the installed engine build version for a run's --backend string.
|
|
2
|
+
|
|
3
|
+
Lemonade has no single "CUDA version" or "ROCm version" field (confirmed
|
|
4
|
+
against a real system-info response) -- what it has is a per-recipe,
|
|
5
|
+
per-backend entry under system_info["recipes"][recipe]["backends"][key],
|
|
6
|
+
each with its own "version" (e.g. llama.cpp's own build tag "b10397") and a
|
|
7
|
+
"state" of "installed" / "installable" / "unsupported". Only "installed"
|
|
8
|
+
means that version is what's actually running; "installable" just means it
|
|
9
|
+
could be downloaded, so it must not be reported as if it were active.
|
|
10
|
+
|
|
11
|
+
The mapping from a free-text --backend string (there is no enum for it in
|
|
12
|
+
the schema) to a (recipe, backend_key) pair is inherently a guess for
|
|
13
|
+
hand-typed strings -- BACKEND_ALIASES covers common display strings
|
|
14
|
+
("llama.cpp-vulkan") confirmed against the real recipes tree. capabilities.py
|
|
15
|
+
instead generates canonical "<recipe_key>-<backend_key>" strings directly
|
|
16
|
+
from Lemonade's own keys (e.g. "llamacpp-vulkan", no dot) for the dashboard's
|
|
17
|
+
backend dropdown -- recipe keys can contain hyphens themselves (e.g.
|
|
18
|
+
"ryzenai-llm", "sd-cpp"), but backend keys never do, so splitting on the
|
|
19
|
+
*last* hyphen recovers both correctly. Unrecognized strings return None
|
|
20
|
+
rather than guessing further.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
from __future__ import annotations
|
|
24
|
+
|
|
25
|
+
BACKEND_ALIASES: dict[str, tuple[str, str]] = {
|
|
26
|
+
"llama.cpp-cpu": ("llamacpp", "cpu"),
|
|
27
|
+
"llama.cpp-vulkan": ("llamacpp", "vulkan"),
|
|
28
|
+
"llama.cpp-rocm": ("llamacpp", "rocm"),
|
|
29
|
+
"llama.cpp-cuda": ("llamacpp", "cuda"),
|
|
30
|
+
"llama.cpp-metal": ("llamacpp", "metal"),
|
|
31
|
+
"llama.cpp-system": ("llamacpp", "system"),
|
|
32
|
+
"fastflowlm-npu": ("flm", "npu"),
|
|
33
|
+
"ryzenai-npu": ("ryzenai-llm", "npu"),
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def resolve_backend(system_info: dict, backend: str) -> tuple[str, str] | None:
|
|
38
|
+
"""Split a --backend string into (recipe_key, backend_key), or None if
|
|
39
|
+
unrecognized. Used both to look up the installed engine version here and,
|
|
40
|
+
in bench.py, to actually tell Lemonade which backend to load (the
|
|
41
|
+
"<recipe>_backend" parameter on POST /api/v1/load) -- without this, a
|
|
42
|
+
load call has no backend selector at all and Lemonade silently falls
|
|
43
|
+
back to the recipe's configured default_backend, which may not be
|
|
44
|
+
installed on this host even when the one the user picked is.
|
|
45
|
+
"""
|
|
46
|
+
if backend in BACKEND_ALIASES:
|
|
47
|
+
return BACKEND_ALIASES[backend]
|
|
48
|
+
|
|
49
|
+
# Canonical "<recipe_key>-<backend_key>" form: split on the last hyphen
|
|
50
|
+
# and confirm the recipe_key half actually exists, since backend keys
|
|
51
|
+
# never contain hyphens but some recipe keys do.
|
|
52
|
+
recipe_key, _, backend_key = backend.rpartition("-")
|
|
53
|
+
if recipe_key and recipe_key in (system_info.get("recipes") or {}):
|
|
54
|
+
return recipe_key, backend_key
|
|
55
|
+
return None
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def lookup_backend_version(system_info: dict, backend: str) -> str | None:
|
|
59
|
+
"""The installed engine build version for `backend`, or None if unknown
|
|
60
|
+
or not actually installed (state != "installed")."""
|
|
61
|
+
resolved = resolve_backend(system_info, backend)
|
|
62
|
+
if resolved is None:
|
|
63
|
+
return None
|
|
64
|
+
recipe_key, backend_key = resolved
|
|
65
|
+
|
|
66
|
+
recipe = (system_info.get("recipes") or {}).get(recipe_key) or {}
|
|
67
|
+
entry = (recipe.get("backends") or {}).get(backend_key) or {}
|
|
68
|
+
if entry.get("state") != "installed":
|
|
69
|
+
return None
|
|
70
|
+
return entry.get("version")
|