Skip to main content

Hexagonal Python application scaffold for llmframe.

Project description

llmframe

Python hexagonal application scaffold for the llmframe repository.

Requirements

  • Python 3.11+
  • uv for environment and dependency management

Setup

Install the project and development dependencies:

uv sync --all-extras

Project layout

The repository follows a hexagonal architecture layout:

src/llmframe/
├── domain/          # Pure business logic and invariants
├── application/     # Use cases and port interfaces
│   └── ports/
└── adapters/        # Input/output adapters at the system boundary
    ├── input/
    └── output/
tests/
├── unit/
└── integration/

LLM adapters

The repository now includes reusable LLM output adapters under llmframe.adapters.output.llm.

Key package areas:

  • llmframe.adapters.output.llm.llm_adapter - high-level structured JSON and text generation adapter
  • llmframe.adapters.output.llm.openai_adapter - OpenAI client builder, transport, DTOs, and parsing helpers
  • llmframe.adapters.output.llm.usage_tracker - aggregated token/cost tracking utilities

Example imports:

from llmframe.adapters.output.llm import LlmAdapter, OpenAIClientSettings, build_client
from llmframe.adapters.output.llm.usage_tracker import LlmUsageTrackerConfig, OpenAILlmUsageTracker

Quality checks

Run the local quality gate with uv:

uv run ruff format .
uv run ruff check .
uv run mypy .
uv run pytest

Release publishing

GitHub Actions publishes this package to PyPI using the workflow at .github/workflows/ci_cd.yaml.

  • Publishing is triggered by pushes to the master branch or manual workflow dispatch.
  • The workflow uses Python Semantic Release to determine the next version from conventional commits, create the release commit and tag, and generate changelog updates.
  • Package artifacts are built in CI and published to PyPI only.
  • If no releasable commits are detected, the publish job is skipped.
  • Publishing targets the llmframe project on pypi.org.

Before the workflow can publish successfully, configure a trusted publisher in the PyPI project settings for this GitHub repository and workflow file.

Also ensure the workflow has permission to use the repository GITHUB_TOKEN for creating release commits and tags.

Example release flow:

git commit -m "feat: add new llm transport option"
git push origin master

Notes

  • The import package name is llmframe.
  • Keep business logic inside domain/ and application/.
  • Keep framework, transport, persistence, and integration concerns in adapters/.

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

llmframe-0.1.0.tar.gz (130.3 kB view details)

Uploaded Source

Built Distribution

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

llmframe-0.1.0-py3-none-any.whl (26.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llmframe-0.1.0.tar.gz
  • Upload date:
  • Size: 130.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for llmframe-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c7bbfb62a8cae70588eae95b7bcf1965a2ef88bed64b4046e004fdac06782491
MD5 79b384e7939ce3c747584d48091de34d
BLAKE2b-256 a2c5ec4489d746443d2e5403759c64b808e11c4cfda2ae55d5ba000218852f21

See more details on using hashes here.

Provenance

The following attestation bundles were made for llmframe-0.1.0.tar.gz:

Publisher: ci_cd.yaml on Nexus-Thread/py-llmframe

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

File details

Details for the file llmframe-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: llmframe-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 26.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for llmframe-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d33dcbbd46b7e2e68d6d91d8f9b82a058f2c0348a7f09a74fb213427a0922ec3
MD5 ac475e975e0ff4a2f135de83d2b9e610
BLAKE2b-256 354f279da2bb69970ce26c4674426ed17ff35f82f308ccf4b66291d4444ee0ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for llmframe-0.1.0-py3-none-any.whl:

Publisher: ci_cd.yaml on Nexus-Thread/py-llmframe

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