Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 166 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
# HyperGen Installation Guide

## Quick Install

### From PyPI (Recommended)

```bash
pip install hypergen
```

This installs both the Python library and the `hypergen` CLI command.

### From Source

```bash
git clone https://github.com/ntegrals/hypergen.git
cd hypergen
pip install -e .
```

## Verify Installation

After installation, verify everything works:

```bash
# Check CLI is available
hypergen --version
hypergen --help

# Test Python import
python -c "from hypergen import model, dataset; print('✓ HyperGen installed successfully')"
```

## CLI Commands

### Serve Command

Start an OpenAI-compatible API server:

```bash
# Basic usage
hypergen serve stabilityai/stable-diffusion-xl-base-1.0

# With options
hypergen serve stabilityai/sdxl-turbo \
--port 8000 \
--api-key your-secret-key \
--dtype float16
```

**All options:**
```bash
hypergen serve --help
```

## For Developers

### Building from Source

```bash
# Install build tools
pip install build twine hatchling

# Build the package
python -m build

# Install locally
pip install dist/*.whl

# Or install in editable mode
pip install -e .
```

### Publishing to PyPI

```bash
# Build
python -m build

# Upload to PyPI
python -m twine upload dist/*
```

## Troubleshooting

### CLI Command Not Found

If `hypergen` command is not found after installation:

1. **Check Python scripts directory is in PATH:**
```bash
python -m site --user-base
```
Add `<site-base>/bin` to your PATH.

2. **Reinstall:**
```bash
pip install --force-reinstall hypergen
```

3. **For editable installs:**
```bash
# Make sure you're in the project root
cd hypergen
pip install -e .
```

4. **Verify entry point:**
```bash
python -m hypergen.cli.main --help
```

### Import Errors

If you get import errors:

```bash
# Make sure you're not in the source directory
cd ~

# Try importing
python -c "from hypergen import model"
```

### Dependencies Issues

Install all dependencies manually:

```bash
pip install torch diffusers transformers peft accelerate \
fastapi uvicorn pillow numpy safetensors
```

## Requirements

- Python 3.10 or higher
- CUDA-capable GPU (for training/inference)
- 12GB+ VRAM recommended for training

## Optional Dependencies

### Flash Attention
```bash
pip install hypergen[flash]
```

### xFormers
```bash
pip install hypergen[xformers]
```

### DeepSpeed
```bash
pip install hypergen[deepspeed]
```

### All Optional Dependencies
```bash
pip install hypergen[all]
```

## Getting Help

- [GitHub Issues](https://github.com/ntegrals/hypergen/issues)
- [Documentation](https://github.com/ntegrals/hypergen)
- [Examples](examples/)
61 changes: 56 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,26 @@ Try HyperGen in interactive Jupyter notebooks:

## ⚡ Quickstart

### Install from PyPI
```bash
pip install hypergen
```

### From Source
**Note:** This will install both the Python library and the `hypergen` CLI command.

### Install from Source
```bash
git clone https://github.com/ntegrals/hypergen.git
cd hypergen
pip install -e .
```

**After installation, verify the CLI is available:**
```bash
hypergen --version
hypergen --help
```

## 🎯 Supported Models

| Model Family | Model ID | Type |
Expand Down Expand Up @@ -136,7 +145,9 @@ images = m.generate(

HyperGen provides a production-ready API server with request queuing, similar to vLLM.

### Start the Server
### CLI Command

After installing HyperGen, the `hypergen` CLI command is available globally:

```bash
# Basic serving
Expand All @@ -156,6 +167,11 @@ hypergen serve black-forest-labs/FLUX.1-dev \
--max-batch-size 4
```

**Available CLI Options:**
```bash
hypergen serve --help
```

### Use with OpenAI Client

```python
Expand Down Expand Up @@ -183,6 +199,17 @@ response = client.images.generate(
- Optional API key authentication
- Production-ready (FastAPI + uvicorn)

**Test the API:**
```bash
# Start the server
hypergen serve stabilityai/sdxl-turbo --port 8000

# Run the test script (in another terminal)
python examples/test_endpoint.py
```

See [test_endpoint.py](examples/test_endpoint.py) for comprehensive endpoint testing.

## ⭐ Key Features

- **Dead Simple API**: Train LoRAs in 5 lines of code - simple for beginners, powerful for experts
Expand All @@ -204,7 +231,10 @@ Code samples in the [examples/](examples/) directory:

- [quickstart.py](examples/quickstart.py) - Minimal 5-line training example
- [complete_example.py](examples/complete_example.py) - All features demonstrated
- [serve_client.py](examples/serve_client.py) - API client usage examples
- [serve_client.py](examples/serve_client.py) - API client usage with OpenAI SDK
- [test_endpoint.py](examples/test_endpoint.py) - Comprehensive API endpoint testing

See the [examples/README.md](examples/README.md) for detailed documentation.

## 🛣️ Roadmap

Expand Down Expand Up @@ -243,12 +273,26 @@ hypergen/

## 💾 Installation

### Basic Installation
### Install from PyPI (Recommended)
```bash
pip install hypergen
```

### From Source
This installs:
- ✅ The `hypergen` Python library
- ✅ The `hypergen` CLI command (globally available)

**Verify installation:**
```bash
# Check CLI is available
hypergen --version
hypergen --help

# Test in Python
python -c "from hypergen import model, dataset; print('✓ HyperGen installed')"
```

### Install from Source
```bash
git clone https://github.com/ntegrals/hypergen.git
cd hypergen
Expand All @@ -257,6 +301,13 @@ pip install -e .

**Requirements**: Python 3.10+

### Troubleshooting

If `hypergen` command is not found after installation:
1. Ensure your Python scripts directory is in PATH
2. Try reinstalling: `pip install --force-reinstall hypergen`
3. For editable installs, use: `pip install -e .` (not `pip install -e src/`)

## 🤝 Contributing

Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
Expand Down
Loading