Metadata-Version: 2.4
Name: model-exporter
Version: 0.1.1
Summary: Universal model weight exporter for multiple formats and inference engines
Author-email: Darshan <therrshan@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/yourusername/abc
Project-URL: Repository, https://github.com/yourusername/abc
Project-URL: Issues, https://github.com/yourusername/abc/issues
Keywords: machine-learning,model-export,inference,gpt2,llama,onnx,gguf
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: torch>=2.0.0
Requires-Dist: transformers>=4.30.0
Requires-Dist: numpy>=1.24.0
Requires-Dist: safetensors>=0.3.0
Requires-Dist: tqdm>=4.65.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Provides-Extra: onnx
Requires-Dist: optimum>=1.12.0; extra == "onnx"
Requires-Dist: onnx>=1.14.0; extra == "onnx"
Provides-Extra: gguf
Requires-Dist: gguf>=0.1.0; extra == "gguf"

# model-exporter

Export HuggingFace models to different formats for inference.

## Installation

```bash
pip install model-exporter
```

## Supported Models

- GPT-2 family: `gpt2`, `gpt2-medium`, `gpt2-large`, `gpt2-xl`, `distilgpt2`

## Supported Formats

- **binary** - Simple binary format for C++ inference
- **safetensors** - Fast and safe tensor format

## Usage

### Export a model

```bash
model-exporter export MODEL_NAME --format FORMAT --output OUTPUT_DIR
```

**Options:**
- `--format` - Export format (binary or safetensors)
- `--output` - Output directory (default: ./weights)
- `--info` - Print model info before export
- `--no-vocab` - Skip vocabulary export

### Examples

```bash
# Export with model info
model-exporter export gpt2-medium --format binary --output ./my_weights --info

# Export without vocabulary
model-exporter export distilgpt2 --format binary --no-vocab
```

## Python API

```python
from model_exporter import get_exporter

# Create exporter
exporter = get_exporter('gpt2')

# Load model
exporter.load_model()

# Export
exporter.export(output_dir='./weights', format_name='binary')
```


## Work in Progress

We're actively working on adding support for:

### Model Families
- **LLaMA/LLaMA-2** - Meta's LLaMA models
- **BERT** - BERT and variants (RoBERTa, DistilBERT)
- **T5/FLAN-T5** - Encoder-decoder models
- **Mistral/Mixtral** - Mistral AI models

### Export Formats
- **GGUF** - llama.cpp compatible format with quantization
- **ONNX** - Cross-platform inference format
- **TensorFlow Lite** - Mobile inference format

### Features
- **Quantization** - int8, int4 quantization support
- **Model sharding** - Split large models across multiple files
- **Batch export** - Export multiple models at once

Want to contribute? Check out our [GitHub repository](https://github.com/therrshan/model-exporters)!

## License

MIT
