Skip to main content

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 TrainingLifecycleBase body, which depends on juniper-model-core (this scaffold does not yet depend on juniper-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

juniper_service_core-0.2.0.tar.gz (110.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

juniper_service_core-0.2.0-py3-none-any.whl (106.9 kB view details)

Uploaded Python 3

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

Hashes for juniper_service_core-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5d589f5438f5c9faf163c170e3d2f79f3435f6738d9c237a7927986bc165239c
MD5 e707e602b89ff582ac1d34ee58c4ab5f
BLAKE2b-256 a03dbe459b20936986b4ed2478ddb83a4fe493834bf14a0ddb2277d2f531a0ca

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file juniper_service_core-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for juniper_service_core-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 229dc7e19a73f6ec220044b299d3fff61607cc1de0e58c5f32afafb3adb776d2
MD5 25885505e381c1be67664c020fb35de8
BLAKE2b-256 6c26a24c21692c3939541d54ab7361ab6d757ff27b38c8c79b56e0b9718ad01d

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page