Metadata-Version: 2.4
Name: autoxlstm
Version: 0.1.0
Summary: Automatic xLSTM architecture configuration, driven by task type and live GPU memory profiling.
Project-URL: Homepage, https://github.com/Natarizki/autoxlstm
Project-URL: Repository, https://github.com/Natarizki/autoxlstm
Author: Natarizki
License: Apache-2.0
License-File: LICENSE
Keywords: autoconfig,deep-learning,llm,pytorch,xlstm
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Requires-Dist: torch>=2.0
Requires-Dist: xlstm>=1.0.3
Provides-Extra: dev
Requires-Dist: pytest-mock>=3.10; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Description-Content-Type: text/markdown

# autoxlstm

Automatic architecture configuration for [xLSTM](https://github.com/NX-AI/xlstm) models — analogous to Hugging Face's `AutoConfig`, but for xLSTM.

`autoxlstm` picks the sLSTM/mLSTM block ratio, head count, and per-head matrix dimension automatically based on:

- **Task type**: coding/math need sLSTM's sequential state tracking; text-generation/time-series favor mLSTM's parallel throughput.
- **Live GPU memory profiling**: an empirical stress-test (sacrificial tensor allocation, catching `torch.cuda.OutOfMemoryError`) finds the largest safe matrix dimension before building the config, instead of guessing from a static formula.

## Install

```bash
pip install -e .

## usage
```python
from autoxlstm import AutoXLSTMConfig

config = AutoXLSTMConfig().create(
    task_type="coding",
    context_length=2048,
    embedding_dim=512,
)

from xlstm import xLSTMBlockStack
model = xLSTMBlockStack(config)
```

## Package Layout

|File | Responsibility|
|:---:|:-------------:|
|engine.py | AutoXLSTMConfig orchestrator|
|profiler.py | GPU inspection + OOM stress-test|
|policies.py | task type → block-ratio (xlstm[N:1]) → slstm_at|
|dims.py | pure num_heads/head_dim resolution|
|validators.py | fail-fast input validation|
|exceptions.py | custom error hierarchy|
|constants.py | all tunable defaults|
