HTTP client for the juniper-recurrence service (the Δt-native LMU recurrence model + cross-validation API)
Project description
juniper-recurrence-client
HTTP client for the juniper-recurrence service — the FastAPI app wrapping the Δt-native LMU
recurrence model and its cross-validation API. A lean requests-based client mirroring
juniper-data-client and
juniper-cascor-client, so consumers
(notably juniper-canopy's recurrence backend adapter) drive every Juniper backend the same way.
Install
pip install juniper-recurrence-client # once published
pip install -e ".[test]" # local development
requests-only at the core; pip install juniper-recurrence-client[observability] adds the
optional juniper-observability integration (X-Request-ID propagation + the on_request hook).
Port:
8211is the juniper-recurrence service's default host port; under Docker it maps to the container's8210(see the app README). Point the client at whicheverhost:portthe service is published on.
Quick start
from juniper_recurrence_client import JuniperRecurrenceClient
client = JuniperRecurrenceClient("http://localhost:8211", api_key="…")
# Train the LMU regressor on a dataset (by id / name / generator)
client.train(name="equities", d=16)
# Predict — inline X with Δt, or a dataset reference
client.predict(dataset_id="ds-1")
# Walk-forward cross-validation over the dataset's _full split
result = client.crossval(name="equities", n_folds=4, scheme="expanding", embargo=2)
print(result["eval_aggregate"])
# Inspect
client.get_model() # topology + metrics
client.training_status() # state + events
client.is_ready() # readiness probe
API surface
| Method | Endpoint |
|---|---|
train(*, dataset_id / name / generator, params, split, d, theta, ridge) |
POST /v1/train |
training_status() |
GET /v1/training/status |
predict(*, X / dt / target_dt / seq_lengths, or a dataset ref) |
POST /v1/predict |
crossval(*, n_folds, scheme, embargo, min_train, dataset ref, d, theta, ridge) |
POST /v1/crossval |
crossval_status() |
GET /v1/crossval/status |
get_model() |
GET /v1/model |
get_dataset() |
GET /v1/dataset |
health_check() / is_ready() / wait_for_ready() |
GET /v1/health[/ready] |
Authentication
Pass api_key=…, or set JUNIPER_RECURRENCE_API_KEY (or the Docker-secret
JUNIPER_RECURRENCE_API_KEY_FILE, a path whose stripped contents are the key). The key is sent
as the X-API-Key header. Note the asymmetry: the server reads the plural
JUNIPER_RECURRENCE_API_KEYS (its accepted set); the client sends one key under the
singular env var.
Errors
All errors derive from JuniperRecurrenceClientError: JuniperRecurrenceConnectionError,
JuniperRecurrenceTimeoutError, JuniperRecurrenceNotFoundError (404),
JuniperRecurrenceConflictError (409 — a run already in progress, or no trained model yet),
JuniperRecurrenceValidationError (400/422), JuniperRecurrenceConfigurationError.
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file juniper_recurrence_client-0.2.0.tar.gz.
File metadata
- Download URL: juniper_recurrence_client-0.2.0.tar.gz
- Upload date:
- Size: 16.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1289a26db15fe7fe6aae33133305201b0c52e95383235a6858dd70c8bda1319f
|
|
| MD5 |
705077dc32d4b55e752bdd0697d71d3b
|
|
| BLAKE2b-256 |
0afb67a613b3c0b792976ab993ffcd85292b72e97e82a2d6642c93cdd61c81ea
|
Provenance
The following attestation bundles were made for juniper_recurrence_client-0.2.0.tar.gz:
Publisher:
publish-recurrence-client.yml on pcalnon/juniper-recurrence
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
juniper_recurrence_client-0.2.0.tar.gz -
Subject digest:
1289a26db15fe7fe6aae33133305201b0c52e95383235a6858dd70c8bda1319f - Sigstore transparency entry: 1944242722
- Sigstore integration time:
-
Permalink:
pcalnon/juniper-recurrence@22f27c660ae81825fd3ee1896af427df71b651fb -
Branch / Tag:
refs/tags/juniper-recurrence-client-v0.2.0 - Owner: https://github.com/pcalnon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-recurrence-client.yml@22f27c660ae81825fd3ee1896af427df71b651fb -
Trigger Event:
push
-
Statement type:
File details
Details for the file juniper_recurrence_client-0.2.0-py3-none-any.whl.
File metadata
- Download URL: juniper_recurrence_client-0.2.0-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83c2fe6d8213f98b45aca93b757148b11027c2229622982582824906e30f6ec0
|
|
| MD5 |
022847e66a00ba3161976b80b80ae382
|
|
| BLAKE2b-256 |
b88fefd974f3e8fd74d27e7d8e4099dee9f6435e510be9ff7a549c345a5f56f2
|
Provenance
The following attestation bundles were made for juniper_recurrence_client-0.2.0-py3-none-any.whl:
Publisher:
publish-recurrence-client.yml on pcalnon/juniper-recurrence
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
juniper_recurrence_client-0.2.0-py3-none-any.whl -
Subject digest:
83c2fe6d8213f98b45aca93b757148b11027c2229622982582824906e30f6ec0 - Sigstore transparency entry: 1944242859
- Sigstore integration time:
-
Permalink:
pcalnon/juniper-recurrence@22f27c660ae81825fd3ee1896af427df71b651fb -
Branch / Tag:
refs/tags/juniper-recurrence-client-v0.2.0 - Owner: https://github.com/pcalnon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-recurrence-client.yml@22f27c660ae81825fd3ee1896af427df71b651fb -
Trigger Event:
push
-
Statement type: