Metadata-Version: 2.4
Name: pfnstudio-core
Version: 0.9.0
Summary: Core abstractions for PFN Studio — Prior, Model, Eval, Run, and the block registry.
Project-URL: Homepage, https://pfnstudio.com
Project-URL: Repository, https://github.com/profitopsai/pfnstudio
Project-URL: Issues, https://github.com/profitopsai/pfnstudio/issues
Project-URL: Documentation, https://github.com/profitopsai/pfnstudio/tree/main/docs
Author: PFN Studio contributors
License: Apache-2.0
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Requires-Dist: numpy>=1.26
Requires-Dist: pandas>=2.0
Requires-Dist: pydantic>=2.6
Requires-Dist: pyyaml>=6.0
Requires-Dist: scikit-learn>=1.3
Provides-Extra: dev
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Provides-Extra: torch
Requires-Dist: torch>=2.2; extra == 'torch'
Description-Content-Type: text/markdown

# pfnstudio-core

The Python contract for PFN Studio FM projects.

```python
from pfnstudio_core import Prior, Model, Run, register_block, register_prior, register_scorer
from pfnstudio_core.scorers.base import DatasetScorer, ScorerResult

@register_prior("my_prior")
class MyPrior(Prior):
    def sample(self, seed: int): ...

@register_block("my_attention")
class MyAttention:
    def __init__(self, d_model: int, n_heads: int): ...

# Paper-specific scorer — ships in the template beside evals/<slug>.yaml.
@register_scorer("my_eval")
class MyScorer(DatasetScorer):
    def score(self, *, model, eval_spec, loader, run_spec) -> ScorerResult: ...
```

The CLI discovers anything registered via these decorators and validates `models/*.yaml` references against the registry.

## Layout

- `prior.py` — `Prior` ABC and built-in prior loader
- `model.py` — `Model` config + block-composition
- `eval.py` — `EvalSpec` — the declarative benchmark spec (dataset + metrics + baselines)
- `scorers/` — `DatasetScorer` — the executable scoring pipeline; core ships only *generic* scorers, paper-specific ones live in templates
- `run.py` — `Run` manifest + executor protocol
- `registry.py` — `@register_prior`, `@register_block`, `@register_scorer` and discovery
- `loaders.py` — load YAML artifacts into typed objects
- `blocks/` — built-in architecture blocks (transformer encoder, causal attention, heads)
- `training/` — minimal in-process training loop for the `local` compute adapter
