Metadata-Version: 2.4
Name: xpyd-sim
Version: 0.5.0
Summary: OpenAI-compatible LLM inference simulator for xPyD
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi>=0.111.0
Requires-Dist: uvicorn>=0.30.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: numpy>=1.26.0
Requires-Dist: scipy>=1.12.0
Requires-Dist: matplotlib>=3.8.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
Requires-Dist: pytest-timeout>=2.3.0; extra == "dev"
Requires-Dist: ruff>=0.3.0; extra == "dev"
Requires-Dist: isort>=5.13.0; extra == "dev"
Provides-Extra: e2e
Requires-Dist: xpyd-proxy>=1.2.0; extra == "e2e"
Dynamic: license-file

# xPyD-sim

**OpenAI-compatible LLM inference simulator for testing and benchmarking.**

xPyD-sim simulates prefill and decode nodes with realistic latency behavior, enabling testing of xPyD-proxy and xPyD-bench without real GPU hardware.

## Key Features

- **Prefill/Decode simulation** — separate modes with configurable latency
- **Full OpenAI API** — /v1/completions, /v1/chat/completions, /v1/embeddings, /v1/models
- **vLLM compatible** — accepts all vLLM-specific parameters
- **Scheduling simulation** — batch formation, decode iteration, queue depth
- **Calibration tool** — fit latency curves from real hardware measurements
- **Prometheus metrics** — /metrics endpoint for monitoring

## Install

```bash
pip install xpyd-sim
```

Or as part of the full xPyD toolkit:

```bash
pip install xpyd
```

## Quick Start

```bash
# Start dual mode (prefill + decode)
xpyd-sim --mode dual --port 8000

# Start PD disaggregated
xpyd-sim --mode prefill --port 8001
xpyd-sim --mode decode --port 8002
```

## Part of xPyD

| Component | Description |
|-----------|-------------|
| [xpyd-proxy](https://github.com/xPyD-hub/xPyD-proxy) | PD-disaggregated proxy |
| **xpyd-sim** | OpenAI-compatible inference simulator |
| [xpyd-bench](https://github.com/xPyD-hub/xPyD-bench) | Benchmarking & planning tool |

📖 **[Full Guide →](docs/guide.md)** | 💡 **[Examples →](examples/)** | 🏗️ **[Contributing →](CONTRIBUTING.md)**

## License

Apache 2.0 — see [LICENSE](LICENSE)
