Skip to main content

gmlcache

generic-ml-cache-core

The hexagonal engine behind gmlcache — embeddable and stateless

License: Apache 2.0 Status: Beta

The reusable hexagonal kernel behind gmlcache: record a real ML client (or API) call once, replay it by its content key. It contains the domain model, the use cases, and the port contracts — the pure hexagonal kernel. Concrete infrastructure (SQLite, filesystem blob store, ML client runners, API adapters, metrics, clock, fingerprinting) lives in generic-ml-cache-adapters.

Pure Python and stateless: it bakes in structure (table names, blob naming, schema) but no location — you inject the data source.

Part of a single-user, local tool — not a gateway. gmlcache records and replays across the subscriptions and APIs you already hold; it is not a multi-user router. See Positioning.

Install

pip install generic-ml-cache-core

Embed it

generic-ml-cache-core provides the ports and use cases. Pair it with generic-ml-cache-adapters for the shipped infrastructure, then wire them in your composition root:

from generic_ml_cache_core import ApplicationApi, ExecutionKind, RunMlExecutionCommand

# wired: ApplicationApi — constructed by your composition root (see adapters package)
command = RunMlExecutionCommand(
    execution_kind=ExecutionKind.LOCAL_MANAGED,
    client="claude", model="claude-sonnet-4-5", effort="", context="", prompt="…",
)
execution = wired.run_ml.execute(command)   # records on a miss, replays on a hit

Need a different store? Implement the ports from generic_ml_cache_core.application.port and pass your own adapters. The core never imports any concrete implementation.

What's inside

  • Domain model — executions, polymorphic call identities, artifacts, usage.
  • Use cases — managed-local / passthrough / API runs, and probe (check).
  • Ports (application/port/...) — client runner, blob store, execution repository, metrics, clock, fingerprint, API client. The gmlcache.adapters entry-point group is discovered and resolved outside core (in the adapters package today).
  • ApplicationApi — typed container of wired use-case references (constructed by the composition root in the adapters or CLI package).

Inbound drivers — gmlcache today, a daemon later — map their surface (a terminal, a REST API) onto these public APIs; the core itself has no UI and reads no config file.

Links

License

Apache-2.0 — see LICENSE and NOTICE.

Release files for generic-ml-cache-core 0.29.0

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

Source distribution (sdist)

Source distribution for generic-ml-cache-core 0.29.0
File Size Uploaded
generic_ml_cache_core-0.29.0.tar.gz 141.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for generic-ml-cache-core 0.29.0
File Interpreter ABI Platform
generic_ml_cache_core-0.29.0-py3-none-any.whl Python 3 none any Details

Total release size: 323.8 kB

Release files / generic_ml_cache_core-0.29.0.tar.gz

Download URL generic_ml_cache_core-0.29.0.tar.gz
Size 141.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a49be9ba066485ce4fbc04bdfe47613b726e37897d80f55dc31936329f993f44
BLAKE2b-256 checksum
How to use checksums
9b3340baf2f9c1e300d5a065fd8ec036923c8d4bef55697cd2fdc3a93f674d2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jul 7, 2026.

Transparency log

Release files / generic_ml_cache_core-0.29.0-py3-none-any.whl

Download URL generic_ml_cache_core-0.29.0-py3-none-any.whl
Size 182.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cecdd0fb96e44694163fd161758d3b50db6704077f75a1f302fb908ebe2fee2e
BLAKE2b-256 checksum
How to use checksums
5fff136764fa92b85e97f2b0ef71b2c300166d0581dc3b817ff57cefdb80a027
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jul 7, 2026.

Transparency log

Release history Release notifications | RSS feed

1.0.0

2 release files

This release

0.29.0 This release

2 release files

0.28.2

2 release files

0.26.0

2 release files

0.25.0

2 release files

0.24.0

2 release files

0.23.0

2 release files

0.22.0

2 release files

0.21.0

2 release files

0.20.0

2 release files

0.19.0

2 release files

0.18.0

2 release files

0.17.0

2 release files

0.16.0

2 release files

0.15.0

2 release files

0.14.0

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

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