coreason-model-foundry
Industrial Automation Engine for Training Specialized "Student Models"
The coreason-model-foundry serves as the "Refinery" in the CoReason AI ecosystem. It is an orchestrator for post-training optimization, designed to select the right mathematical strategy (DoRA, ORPO, QLoRA) for the task, prune data for maximum information density, and distribute the resulting artifacts safely.
It implements a Select-Prune-Train-Merge-Distribute Loop, utilizing unsloth for accelerated training and mergekit for model merging.
Features
- Polymorphic Training Architecture: Dynamically loads the training kernel based on the goal:
- DoRA: Logic & Math (via
UnslothSFTTrainer). - ORPO: Alignment & Safety (via
UnslothORPOTrainer). - QLoRA: Memory Efficiency (via 4-bit quantization).
- DoRA: Logic & Math (via
- Data Curator: Maximizes "Information Density" using Semantic Deduplication (
SemDeDup) to remove 95%+ similar duplicates. - Hardware Safety: "Fail Fast" mechanism prevents OOM crashes by validating VRAM requirements (e.g., enforces 24GB for full ORPO).
- The Alchemist (Merging): Integrates
mergekitto combine adapters using the DARE-TIES algorithm. - Artifact Distribution: Automatically pushes trained models to the
coreason-publisherregistry. - GxP Compliance: Calculates provenance hashes (Lot Numbers) for datasets and manifests.
Installation
pip install -r requirements.txt
Note: This library relies on unsloth and torch (CUDA). Ensure these are installed in your environment suitable for your hardware.
Usage
Python API
from coreason_model_foundry import orchestrate_training
# Run the full training pipeline with a manifest file
orchestrate_training("manifest.yaml")
Example Manifest
job_id: "train-prod-2025-01-15"
base_model: "unsloth/llama-3-8b-bnb-4bit"
method_config:
type: "orpo"
rank: 64
strict_hardware_check: true
dataset:
ref: "synthesis://batch_clinical_reasoning"
sem_dedup: true
compute:
batch_size: 4
grad_accum: 4
Metadata
Release files for coreason-model-foundry 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| coreason_model_foundry-0.2.1.tar.gz | 22.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| coreason_model_foundry-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 61.0 kB
Release files / coreason_model_foundry-0.2.1.tar.gz
| Download URL | coreason_model_foundry-0.2.1.tar.gz |
|---|---|
| Size | 22.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cba69865314c4764c3a42b94eaea6cdf44ab9e07ad9fe8abe63c4d966f51641c
|
|
BLAKE2b-256 checksum How to use checksums |
287ad65356b1fbec45348bbc0d46d971c9b725058dfde56a51e39d16d4f516e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 29, 2026.
Transparency logRelease files / coreason_model_foundry-0.2.1-py3-none-any.whl
| Download URL | coreason_model_foundry-0.2.1-py3-none-any.whl |
|---|---|
| Size | 38.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7990416780ba11e175406071e1318a37b1485942480a90901c8372e75c64f899
|
|
BLAKE2b-256 checksum How to use checksums |
e3d2edaa58afef4a9a7e7f69b19caf961d9338e598cfa13933f24fc7153e448b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 29, 2026.
Transparency log