Shared service-tier scaffolding (FastAPI app factory, settings base, generic routes) for Juniper ML model services
Project description
juniper-service-core
Project: Juniper — Cascade Correlation Neural Network Research Platform Application: juniper-service-core (subdirectory of juniper-ml) Author: Paul Calnon License: MIT License Version: 0.1.0
Shared service-tier scaffolding for Juniper ML model services: a model-agnostic
FastAPI application factory, a pydantic-settings base, and a generic
liveness/readiness health router. This is WS-2 of the model/middleware refactor
(notes/JUNIPER_MODEL_MIDDLEWARE_REFACTOR_DESIGN_AND_PLAN_2026-05-31.md in the
juniper-ml repo).
The -core suffix marks it as genuinely shared: it carries no model,
classification, or training logic — those stay in the owning service (e.g.
juniper-cascor) and are passed in.
Install
pip install juniper-service-core
What's in this scaffold
| Surface | Module | Purpose |
|---|---|---|
create_app(...) |
juniper_service_core.app |
FastAPI app factory: mounts the health router, then any service-supplied routers. Model-agnostic. |
SettingsBase |
juniper_service_core.settings |
pydantic-settings base with generic fields (service_name, host, port, log_level). Subclasses set their own env_prefix. |
health_router() |
juniper_service_core.health |
Generic APIRouter exposing GET /v1/health (liveness) and GET /v1/health/ready (readiness). |
Dependency-free top-level import
import juniper_service_core pulls no third-party runtime dependency. Only
__version__ is exposed eagerly; create_app and SettingsBase are imported lazily
on attribute access (PEP 562 __getattr__) from submodules that require fastapi /
pydantic-settings. This lets the TestPyPI publish-verify run a clean --no-deps
import check.
Usage
from juniper_service_core import create_app, SettingsBase
from pydantic_settings import SettingsConfigDict
class MyServiceSettings(SettingsBase):
model_config = SettingsConfigDict(env_prefix="JUNIPER_MYSVC_")
app = create_app(title="My Service", version="1.0.0", routers=[...])
# GET /v1/health -> {"status": "ok"}
# GET /v1/health/ready -> {"status": "ready"}
What's deferred
This first PR is an additive package skeleton. The following are intentionally not in this scaffold and arrive in later WS-2 follow-ups:
- Extraction of the security / middleware / websocket / worker / generic-route
helpers from
juniper-cascor. - The
TrainingLifecycleBasebody, which depends onjuniper-model-core(this scaffold does not yet depend onjuniper-model-core).
Development
pip install -e ".[test]"
pytest tests/ -v
Project details
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_service_core-0.2.0.tar.gz.
File metadata
- Download URL: juniper_service_core-0.2.0.tar.gz
- Upload date:
- Size: 110.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d589f5438f5c9faf163c170e3d2f79f3435f6738d9c237a7927986bc165239c
|
|
| MD5 |
e707e602b89ff582ac1d34ee58c4ab5f
|
|
| BLAKE2b-256 |
a03dbe459b20936986b4ed2478ddb83a4fe493834bf14a0ddb2277d2f531a0ca
|
Provenance
The following attestation bundles were made for juniper_service_core-0.2.0.tar.gz:
Publisher:
publish-service-core.yml on pcalnon/juniper-ml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
juniper_service_core-0.2.0.tar.gz -
Subject digest:
5d589f5438f5c9faf163c170e3d2f79f3435f6738d9c237a7927986bc165239c - Sigstore transparency entry: 1917753482
- Sigstore integration time:
-
Permalink:
pcalnon/juniper-ml@a10820ed1e5c1309bf6221aeb8529619aa0962a7 -
Branch / Tag:
refs/tags/juniper-service-core-v0.2.0 - Owner: https://github.com/pcalnon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-service-core.yml@a10820ed1e5c1309bf6221aeb8529619aa0962a7 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file juniper_service_core-0.2.0-py3-none-any.whl.
File metadata
- Download URL: juniper_service_core-0.2.0-py3-none-any.whl
- Upload date:
- Size: 106.9 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 |
229dc7e19a73f6ec220044b299d3fff61607cc1de0e58c5f32afafb3adb776d2
|
|
| MD5 |
25885505e381c1be67664c020fb35de8
|
|
| BLAKE2b-256 |
6c26a24c21692c3939541d54ab7361ab6d757ff27b38c8c79b56e0b9718ad01d
|
Provenance
The following attestation bundles were made for juniper_service_core-0.2.0-py3-none-any.whl:
Publisher:
publish-service-core.yml on pcalnon/juniper-ml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
juniper_service_core-0.2.0-py3-none-any.whl -
Subject digest:
229dc7e19a73f6ec220044b299d3fff61607cc1de0e58c5f32afafb3adb776d2 - Sigstore transparency entry: 1917753566
- Sigstore integration time:
-
Permalink:
pcalnon/juniper-ml@a10820ed1e5c1309bf6221aeb8529619aa0962a7 -
Branch / Tag:
refs/tags/juniper-service-core-v0.2.0 - Owner: https://github.com/pcalnon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-service-core.yml@a10820ed1e5c1309bf6221aeb8529619aa0962a7 -
Trigger Event:
workflow_dispatch
-
Statement type: