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.1.0.tar.gz (24.6 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.1.0-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file juniper_service_core-0.1.0.tar.gz.

File metadata

  • Download URL: juniper_service_core-0.1.0.tar.gz
  • Upload date:
  • Size: 24.6 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.1.0.tar.gz
Algorithm Hash digest
SHA256 1e1d569ee5e0ca1adae39d71036c580da5f311e2921cf0f1425f3c70a0cd3a3e
MD5 5d065341075a5b20e026c50844988308
BLAKE2b-256 eea1111e40b48b896a922672b88407f4cea2317b0c11e1a67968606d8c5373f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for juniper_service_core-0.1.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.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for juniper_service_core-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb6467d0b2be7d17f6182c0427dbbe32c45ab7cde69d57498c859ea0e208f684
MD5 c1cf14d7c420f0330d30ffe4543b3ac4
BLAKE2b-256 75525738eec769e946b8cf0585c1da762092b56c12408e7b7c9d292d9c10ad8e

See more details on using hashes here.

Provenance

The following attestation bundles were made for juniper_service_core-0.1.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