Skip to main content

hugpy-engine

hugpy-engine is the standalone boundary for Hugpy's complete inference path:

prompt/messages
    -> model discovery and resolution
    -> RAM/VRAM allocation and admission
    -> engine and runner selection/loading
    -> generation and continuation
    -> streamed events or a completed reply

The package is split by responsibility:

  • catalog — discovered models, task/media/default model resolution;
  • allocation — feasible modes, default placement, spill and admission plans;
  • engines — native llama.cpp discovery and GGUF runner lifecycle;
  • runtime — request resolution, execution, runner caching and eviction;
  • query — prompt/messages to streamed events, text, or QueryResult;
  • backend — the injection contract joining those layers to an implementation.

The package imports CPU-only: import hugpy_engine never loads llama_cpp, torch, transformers or peft. Those arrive through extras and are imported by the runner that needs them:

extra provides
hugpy-engine[gguf] in-process GGUF inference via llama-cpp-python
hugpy-engine[transformers] the transformers text-generation runner
hugpy-engine[finetune] PEFT adapter loading
hugpy-engine[index] the optional Postgres model index

The default backend is the in-process LocalBackend (hugpy_engine.backends), built from the engine's own catalog, allocation, native-engine and dispatch modules; configure_backend(...) / backend_scope(...) swap in another InferenceBackend (a fake in tests, a remote proxy in a thin client).

from hugpy_engine import query_sync

reply = query_sync("Explain tensor parallelism", model_key="my-model")

Async callers use await query(...). stream_query(...) yields engine events; query_result(...) retains request ID, finish reason, usage, and timings.

Seams (what the engine asks of the packages above it)

  • hugpy_engine.placement — Protocols + get_*()/set_*() providers for everything the engine asks about the fleet (worker registry and key forms, worker HTTP transport/breaker, eviction telemetry ledger, blocklist, model metrics, priority groups). Null defaults mean "no fleet"; hugpy_fleet implements them and the server wires them.
  • hugpy_engine.tasks — the task-runner registry. Media and video runners plug in with register_task(task, runner=..., build_request=..., frameworks=(...), extra=..., source=...); FRAMEWORK_RUNNERS, MODEL_REQUEST_BUILDERS and KNOWN_TASKS_REGISTRY in hugpy_engine.resolvers.categories are live views over it. Packages may also expose a hugpy_engine.tasks entry point (a zero-arg register function); the engine loads those on first use.
  • hugpy_engine.catalog_bridge — installs the engine's registry as hugpy_storage's catalog source, the hot cache as its serve-path hook, and refreshes discovery on hugpy_control.bus catalog.changed events. LocalBackend installs it lazily.
  • hugpy_engine.name_match — the pure eliminate-then-rank name pipeline (resolve_name, Candidate) that assure_model_key uses; the oracle re-exports it.

Metadata

Release files for hugpy-engine 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hugpy-engine 0.2.4
File Size Uploaded
hugpy_engine-0.2.4.tar.gz 656.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hugpy-engine 0.2.4
File Interpreter ABI Platform
hugpy_engine-0.2.4-py3-none-any.whl Python 3 none any Details

Total release size: 1.2 MB

Release files / hugpy_engine-0.2.4.tar.gz

Download URL hugpy_engine-0.2.4.tar.gz
Size 656.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1a7ab40dff6463719199808c718d62ec789ac1b2805a72f38d9c4d0c4de95a56
BLAKE2b-256 checksum
How to use checksums
e164505e25871164bfd3a6d916accd803f8c5393b22ca0526fa71ff7c1f3bc9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / hugpy_engine-0.2.4-py3-none-any.whl

Download URL hugpy_engine-0.2.4-py3-none-any.whl
Size 556.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4e568ced85cb4e547b175be0853b40707c09173a6b338337dd297f9f8295dca3
BLAKE2b-256 checksum
How to use checksums
3bed6d9430fb77d0430ce74a6d0ca66437ce778e5c717aef44a368af543fd3e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.6

2 release files

0.2.5

2 release files

This release

0.2.4 This release

2 release files

0.2.3

2 release files

0.2.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page