hugpy-engine 0.3.7__tar.gz → 0.3.9__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 (53) hide show
  1. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/PKG-INFO +1 -1
  2. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/pyproject.toml +1 -1
  3. hugpy_engine-0.3.9/src/hugpy_engine/core_auth.py +14 -0
  4. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/llama/runners/fitevict_runner.py +2 -1
  5. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/resolvers/task_resolution.py +2 -1
  6. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/task_endpoints.py +94 -3
  7. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine.egg-info/PKG-INFO +1 -1
  8. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine.egg-info/SOURCES.txt +1 -0
  9. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/README.md +0 -0
  10. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/setup.cfg +0 -0
  11. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/__init__.py +0 -0
  12. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/categories.py +0 -0
  13. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/config/__init__.py +0 -0
  14. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/config/main.py +0 -0
  15. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/config/models/__init__.py +0 -0
  16. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/config/models/models_config.py +0 -0
  17. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/config/models/models_default.py +0 -0
  18. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/dispatch/__init__.py +0 -0
  19. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/dispatch/dispatch.py +0 -0
  20. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/fit/__init__.py +0 -0
  21. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/fit/types.py +0 -0
  22. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/imports/__init__.py +0 -0
  23. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/imports/classes.py +0 -0
  24. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/imports/constants.py +0 -0
  25. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/imports/functions.py +0 -0
  26. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/imports/init_imports.py +0 -0
  27. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/llama/__init__.py +0 -0
  28. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/llama/runners/__init__.py +0 -0
  29. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/name_match.py +0 -0
  30. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/placement.py +0 -0
  31. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/py.typed +0 -0
  32. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/resolvers/__init__.py +0 -0
  33. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/resolvers/assure_model_key.py +0 -0
  34. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/resolvers/categories/__init__.py +0 -0
  35. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/resolvers/categories/builders.py +0 -0
  36. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/resolvers/categories/frameworks.py +0 -0
  37. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/resolvers/model_resolver.py +0 -0
  38. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/schemas/__init__.py +0 -0
  39. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/schemas/chat_schemas.py +0 -0
  40. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/schemas/event_schemas.py +0 -0
  41. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/schemas/metadata_schemas.py +0 -0
  42. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/schemas/model_schemas.py +0 -0
  43. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/schemas/runner_schemas.py +0 -0
  44. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/schemas/task_schemas.py +0 -0
  45. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/task_deps.py +0 -0
  46. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/tasks.py +0 -0
  47. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/utils/__init__.py +0 -0
  48. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/utils/json_scavenge.py +0 -0
  49. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/utils/model_marker.py +0 -0
  50. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine/utils/no_think.py +0 -0
  51. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine.egg-info/dependency_links.txt +0 -0
  52. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/src/hugpy_engine.egg-info/requires.txt +0 -0
  53. {hugpy_engine-0.3.7 → hugpy_engine-0.3.9}/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.7
3
+ Version: 0.3.9
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.7"
7
+ version = "0.3.9"
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,14 @@
1
+ """Server-side authentication for calls to the configured Core, never other URLs."""
2
+ import os
3
+ from urllib.parse import urlsplit
4
+
5
+
6
+ def core_headers(url, headers=None):
7
+ result = dict(headers or {})
8
+ core = (os.environ.get("HUGPY_CORE_URL") or os.environ.get("HUGPY_FITEVICT_FRONT_DOOR")
9
+ or "http://127.0.0.1:7020").rstrip("/")
10
+ target, expected = urlsplit(url), urlsplit(core)
11
+ key = os.environ.get("HUGPY_PUBLIC_API_KEY") or os.environ.get("HUGPY_ROUTER_KEY")
12
+ if key and (target.scheme, target.netloc) == (expected.scheme, expected.netloc) and target.path.startswith(expected.path.rstrip("/") + "/"):
13
+ result["Authorization"] = "Bearer " + key
14
+ return result
@@ -116,9 +116,10 @@ class FitevictChatRunner:
116
116
  return body
117
117
 
118
118
  def _post(self, body: dict) -> "tuple[int, dict]":
119
+ from hugpy_engine.core_auth import core_headers
119
120
  req = urllib.request.Request(FRONT_DOOR + "/v1/chat/completions",
120
121
  data=json.dumps(body).encode("utf-8"),
121
- headers={"Content-Type": "application/json"},
122
+ headers=core_headers(FRONT_DOOR + "/v1/chat/completions", {"Content-Type": "application/json"}),
122
123
  method="POST")
123
124
  try:
124
125
  with urllib.request.urlopen(req, timeout=TIMEOUT_S) as r:
@@ -507,7 +507,8 @@ def resolve(task=None, model_key=None, media_type=None, *, catalog=None,
507
507
  # LOADERS — thin stdlib fetchers (core_url, timeout). Never raise.
508
508
  # ---------------------------------------------------------------------------
509
509
  def _get_json(url, timeout):
510
- req = urllib.request.Request(url, headers={"Accept": "application/json"})
510
+ from hugpy_engine.core_auth import core_headers
511
+ req = urllib.request.Request(url, headers=core_headers(url, {"Accept": "application/json"}))
511
512
  with urllib.request.urlopen(req, timeout=timeout) as r:
512
513
  return json.loads(r.read().decode("utf-8") or "null")
513
514
 
@@ -67,6 +67,18 @@ TASK_ROUTES: dict[str, tuple[str, str]] = {
67
67
  "inpainting": ("/v1/images/generations", "image"),
68
68
  "text-to-video": ("/v1/videos/generations", "video"),
69
69
  "image-to-video": ("/v1/videos/generations", "video"),
70
+ # ADDITIVE (2026-10-21, wrapper 0.1.149 batch C): VACE video-to-video rides the
71
+ # same videogen route (operation="v2v" + a video input); the LTX latent
72
+ # upsampler is its own runner/route (videoupres, task "video-upscale").
73
+ "video-to-video": ("/v1/videos/generations", "video"),
74
+ "video-upscale": ("/v1/videos/upscale", "video"),
75
+ # ADDITIVE (2026-10-21, wrapper 0.1.149 batch F — abstract-identity GPU
76
+ # execution): Hunyuan3D image-to-3d (a GLB mesh artifact), and the ONE char360
77
+ # child's two routes (person-tracking over a clip, and face embeddings over a
78
+ # list of images) — both return JSON (dets/faces + an .npy embeddings artifact).
79
+ "image-to-3d": ("/v1/meshes/generations", "mesh"),
80
+ "video-person-tracking": ("/v1/videos/track", "json"),
81
+ "face-embeddings": ("/v1/faces/embeddings", "json"),
70
82
  }
71
83
 
72
84
 
@@ -108,13 +120,62 @@ _BODY_SPECS: dict[str, dict] = {
108
120
  "input_key": "prompt", "sources": ("prompt", "input", "text"),
109
121
  "passthrough": ("n", "size", "steps", "num_inference_steps",
110
122
  "guidance_scale", "negative_prompt", "seed", "width",
111
- "height", "image", "mask", "strength", "_route"),
123
+ "height", "image", "image_path", "image_b64", "mask", "mask_path", "mask_b64",
124
+ "strength", "sampler_name", "scheduler", "denoise", "response_format",
125
+ "metadata", "placement_intent", "max_wait_s", "keep_artifacts", "_route"),
112
126
  },
113
127
  "/v1/videos/generations": {
114
128
  "input_key": "prompt", "sources": ("prompt", "input", "text"),
129
+ # ADDITIVE (2026-10-21, hugpy-video render-path hardening): forward the
130
+ # observability/placement knobs the videogen front door honours —
131
+ # * metadata -> fitevict records metadata.parent_request_id on the
132
+ # call_log row, so the studio orbit client can find its
133
+ # own in-flight call while it blocks (serve/front_door
134
+ # _placement reads body["metadata"]["parent_request_id"]).
135
+ # * max_wait_s -> the per-call front-door contract budget (cold loads).
136
+ # * placement_intent-> a recorded placement hint (pair knobs stay authoritative).
137
+ # * keep_artifacts -> keep the wrapper's mp4 on disk for a same-box PATH read.
138
+ # None of these are task-resolution inputs; they are passthrough body fields.
115
139
  "passthrough": ("num_frames", "fps", "seed", "width", "height", "steps",
116
140
  "num_inference_steps", "guidance_scale", "image", "image_b64",
117
- "negative_prompt", "response_format"),
141
+ "negative_prompt", "response_format",
142
+ "metadata", "max_wait_s", "placement_intent", "keep_artifacts",
143
+ # ADDITIVE (2026-10-21, wrapper batch C W2a — VACE v2v inputs):
144
+ "video", "video_b64", "reference_images", "control_kind",
145
+ "control_image", "mask", "source_frames", "context_frames",
146
+ "operation", "flow_shift"),
147
+ },
148
+ # ADDITIVE (2026-10-21, wrapper batch C W2b): the LTX latent upsampler route.
149
+ "/v1/videos/upscale": {
150
+ "input_key": None, "sources": (),
151
+ "passthrough": ("video", "video_b64", "scale", "width", "height", "fps",
152
+ "response_format", "metadata", "max_wait_s",
153
+ "placement_intent", "keep_artifacts"),
154
+ },
155
+ # ADDITIVE (2026-10-21, wrapper batch F): Hunyuan3D image-to-3d. No single
156
+ # prompt — the payload is the ``views`` object ({front[,back,left,right]},
157
+ # each {b64|artifact_id}); the rest are generation/placement knobs.
158
+ "/v1/meshes/generations": {
159
+ "input_key": None, "sources": (),
160
+ "passthrough": ("views", "texture", "remove_background", "subfolder",
161
+ "octree_resolution", "steps", "num_inference_steps",
162
+ "guidance_scale", "seed", "output_name", "response_format",
163
+ "metadata", "max_wait_s", "placement_intent", "keep_artifacts"),
164
+ },
165
+ # ADDITIVE (2026-10-21, wrapper batch F): char360 person-tracking over a clip.
166
+ # ``video`` is a {b64|artifact_id} object (bounded, wrapper §1).
167
+ "/v1/videos/track": {
168
+ "input_key": None, "sources": (),
169
+ "passthrough": ("video", "video_b64", "stride", "min_h_frac", "scenes",
170
+ "crops", "response_format", "metadata", "max_wait_s",
171
+ "placement_intent", "keep_artifacts"),
172
+ },
173
+ # ADDITIVE (2026-10-21, wrapper batch F): char360 face embeddings over a list
174
+ # of {b64|artifact_id} images.
175
+ "/v1/faces/embeddings": {
176
+ "input_key": None, "sources": (),
177
+ "passthrough": ("images", "det_size", "response_format", "metadata",
178
+ "max_wait_s", "placement_intent", "keep_artifacts"),
118
179
  },
119
180
  }
120
181
 
@@ -160,6 +221,35 @@ def build_endpoint_request(kwargs: dict, model_key: str, *, task: str,
160
221
  for k in spec.get("passthrough", ()):
161
222
  if kwargs.get(k) is not None:
162
223
  body[k] = kwargs[k]
224
+ if route == "/v1/images/generations":
225
+ # The old image builders use num_images / num_inference_steps; Comfy's
226
+ # worker workflow consumes n / steps. Normalize without losing explicit
227
+ # zero CFG or caller-selected samplers and schedulers.
228
+ for canonical, aliases in {
229
+ "n": ("num_images",), "steps": ("num_inference_steps",),
230
+ "guidance_scale": ("cfg_scale", "cfg", "guidance"),
231
+ "negative_prompt": ("negative",), "sampler_name": ("sampler",),
232
+ }.items():
233
+ for name in (canonical, *aliases):
234
+ if kwargs.get(name) is not None:
235
+ body[canonical] = kwargs[name]
236
+ break
237
+ if kwargs.get("return_b64") is True and "response_format" not in body:
238
+ body["response_format"] = "b64_json"
239
+ for field in ("image", "mask"):
240
+ value = body.get(field)
241
+ path = body.pop(field + "_path", None)
242
+ if isinstance(value, str):
243
+ path = value
244
+ if path and not isinstance(value, dict) and not body.get(field + "_b64"):
245
+ if os.path.isfile(path):
246
+ with open(path, "rb") as handle:
247
+ raw = handle.read(64 * 1024 * 1024 + 1)
248
+ if len(raw) > 64 * 1024 * 1024:
249
+ raise ValueError(field + " exceeds the 64 MiB inline input limit")
250
+ body[field] = {"b64": base64.b64encode(raw).decode("ascii")}
251
+ else:
252
+ body[field] = {"path": path}
163
253
  rid = kwargs.get("request_id") or make_request_id()
164
254
  return EndpointRequest(request_id=rid, model_key=model_key, route=route,
165
255
  body=body, output=output,
@@ -180,8 +270,9 @@ class TaskEndpointRunner:
180
270
  self.model_key = getattr(cfg, "model_key", None)
181
271
 
182
272
  def _post(self, url: str, body: dict, timeout: float) -> "tuple[int, dict]":
273
+ from hugpy_engine.core_auth import core_headers
183
274
  req = urllib.request.Request(url, data=json.dumps(body).encode("utf-8"),
184
- headers={"Content-Type": "application/json"},
275
+ headers=core_headers(url, {"Content-Type": "application/json"}),
185
276
  method="POST")
186
277
  try:
187
278
  with urllib.request.urlopen(req, timeout=timeout) as r:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hugpy-engine
3
- Version: 0.3.7
3
+ Version: 0.3.9
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
@@ -2,6 +2,7 @@ README.md
2
2
  pyproject.toml
3
3
  src/hugpy_engine/__init__.py
4
4
  src/hugpy_engine/categories.py
5
+ src/hugpy_engine/core_auth.py
5
6
  src/hugpy_engine/name_match.py
6
7
  src/hugpy_engine/placement.py
7
8
  src/hugpy_engine/py.typed
File without changes
File without changes