hugpy-engine 0.3.1__tar.gz → 0.3.2__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 (41) hide show
  1. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/PKG-INFO +1 -1
  2. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/pyproject.toml +1 -1
  3. hugpy_engine-0.3.2/src/hugpy_engine/task_deps.py +67 -0
  4. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine.egg-info/PKG-INFO +1 -1
  5. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine.egg-info/SOURCES.txt +1 -0
  6. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/README.md +0 -0
  7. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/setup.cfg +0 -0
  8. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/__init__.py +0 -0
  9. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/categories.py +0 -0
  10. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/config/__init__.py +0 -0
  11. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/config/main.py +0 -0
  12. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/config/models/__init__.py +0 -0
  13. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/config/models/models_config.py +0 -0
  14. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/config/models/models_default.py +0 -0
  15. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/dispatch/__init__.py +0 -0
  16. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/dispatch/dispatch.py +0 -0
  17. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/fit/__init__.py +0 -0
  18. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/fit/types.py +0 -0
  19. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/llama/__init__.py +0 -0
  20. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/llama/runners/__init__.py +0 -0
  21. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/llama/runners/fitevict_runner.py +0 -0
  22. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/name_match.py +0 -0
  23. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/placement.py +0 -0
  24. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/py.typed +0 -0
  25. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/resolvers/__init__.py +0 -0
  26. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/resolvers/assure_model_key.py +0 -0
  27. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/resolvers/categories/__init__.py +0 -0
  28. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/resolvers/categories/builders.py +0 -0
  29. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/resolvers/categories/frameworks.py +0 -0
  30. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/resolvers/model_resolver.py +0 -0
  31. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/schemas/__init__.py +0 -0
  32. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/schemas/chat_schemas.py +0 -0
  33. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/schemas/event_schemas.py +0 -0
  34. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/schemas/metadata_schemas.py +0 -0
  35. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/schemas/model_schemas.py +0 -0
  36. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/schemas/runner_schemas.py +0 -0
  37. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/schemas/task_schemas.py +0 -0
  38. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine/tasks.py +0 -0
  39. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine.egg-info/dependency_links.txt +0 -0
  40. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine.egg-info/requires.txt +0 -0
  41. {hugpy_engine-0.3.1 → hugpy_engine-0.3.2}/src/hugpy_engine.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hugpy-engine
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: Hugpy engine: model discovery and classification, allocation and eviction, native llama.cpp and GGUF runners, and the prompt-to-reply inference path with task and placement seams
5
5
  Author-email: putkoff <support@hugpy.ai>
6
6
  License-Expression: LicenseRef-Proprietary
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "hugpy-engine"
7
- version = "0.3.1"
7
+ version = "0.3.2"
8
8
  description = "Hugpy engine: model discovery and classification, allocation and eviction, native llama.cpp and GGUF runners, and the prompt-to-reply inference path with task and placement seams"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -0,0 +1,67 @@
1
+ """Canonical ML-amenity task -> dependency map + a cheap capability probe.
2
+
3
+ Single source of truth shared by:
4
+ * central's ``/ml`` readiness (``flask_app.../ml_routes`` builds its route-keyed
5
+ ``ML_DEP`` from this), and
6
+ * the worker agent's advertised ``task_capabilities`` heartbeat field
7
+ (``worker_agent.agent._task_capabilities``),
8
+ so the two can never DRIFT on which import module powers which dispatch task.
9
+
10
+ Deliberately dependency-free (stdlib ``importlib`` only): central imports it in a
11
+ phone-clean ``GET /ml`` and the worker imports it to build EVERY heartbeat, so it
12
+ must never drag a heavy ML import. The probe is ``find_spec`` ONLY — it resolves
13
+ whether a module is importable without importing it. The one task where
14
+ ``find_spec`` is insufficient (whisper: resolvable yet ``import whisper`` can die
15
+ under the numba/numpy>=2.5 landmine, 2026-07-11) keeps its guarded real import in
16
+ the worker agent, on top of this map.
17
+ """
18
+ from __future__ import annotations
19
+
20
+ import importlib.util
21
+ from typing import Dict, Tuple
22
+
23
+ # task (the dispatch/`/ml` task key) -> (import module, pip extra that provides it).
24
+ # Mirrors — and is the source for — ml_routes.ML_DEP (which is keyed by ROUTE name
25
+ # and joins through ml_routes.ML_TASKS). Keep the two key spaces in sync via that
26
+ # join, never by hand-copying values.
27
+ TASK_DEPS: Dict[str, Tuple[str, str]] = {
28
+ "automatic-speech-recognition": ("whisper", "audio"),
29
+ # SPEECH OUT (chatterbox seat). The distribution is ``chatterbox-tts`` and
30
+ # the import name is ``chatterbox`` — they differ, and this table's probe is
31
+ # by MODULE, so the module name is what belongs here. A worker that seats the
32
+ # backend in a per-model env-PROFILE venv (its torch pins collide with the
33
+ # agent's) answers False to this find_spec and True to the agent's overlay —
34
+ # see managers.tts.seat, the same shape as the whisper special case below.
35
+ "text-to-speech": ("chatterbox", "tts"),
36
+ "text-summarization": ("transformers", "transformers"),
37
+ "keyword-extraction": ("keybert", "keywords"),
38
+ "feature-extraction": ("sentence_transformers", "embed"),
39
+ "sentence-similarity": ("sentence_transformers", "embed"),
40
+ "image-text-to-text": ("llama_cpp", "engine"),
41
+ "text-to-image": ("diffusers", "imagegen"),
42
+ "document-extraction": ("pdfplumber", "extract"),
43
+ "url-extraction": ("bs4", "web"),
44
+ "depth-estimation": ("transformers", "transformers"),
45
+ "object-detection": ("transformers", "transformers"),
46
+ "image-classification": ("transformers", "transformers"),
47
+ "image-segmentation": ("transformers", "transformers"),
48
+ }
49
+
50
+
51
+ def have(mod: str) -> bool:
52
+ """Whether ``mod`` is importable — ``find_spec`` only, never imports it."""
53
+ try:
54
+ return importlib.util.find_spec(mod) is not None
55
+ except (ImportError, ValueError):
56
+ return False
57
+
58
+
59
+ def task_capabilities() -> Dict[str, bool]:
60
+ """``{task: bool}`` from the ``find_spec`` probe (cheap, no heavy imports).
61
+
62
+ The worker overlays TWO special cases on top of this base map before
63
+ advertising it (see worker_agent.agent._task_capabilities): whisper (a
64
+ guarded real import) and text-to-speech (a seat that may live in a separate
65
+ env-profile venv, which no probe of THIS interpreter can see).
66
+ """
67
+ return {task: have(mod) for task, (mod, _extra) in TASK_DEPS.items()}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hugpy-engine
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: Hugpy engine: model discovery and classification, allocation and eviction, native llama.cpp and GGUF runners, and the prompt-to-reply inference path with task and placement seams
5
5
  Author-email: putkoff <support@hugpy.ai>
6
6
  License-Expression: LicenseRef-Proprietary
@@ -5,6 +5,7 @@ src/hugpy_engine/categories.py
5
5
  src/hugpy_engine/name_match.py
6
6
  src/hugpy_engine/placement.py
7
7
  src/hugpy_engine/py.typed
8
+ src/hugpy_engine/task_deps.py
8
9
  src/hugpy_engine/tasks.py
9
10
  src/hugpy_engine.egg-info/PKG-INFO
10
11
  src/hugpy_engine.egg-info/SOURCES.txt
File without changes
File without changes