# Show HN: Tynx - train ONNX models with a PyTorch-shaped API (<20 MB whl)

> Source: <https://github.com/blaind/tynx/>
> Published: 2026-08-12 05:31:36+00:00

Tynx is a small, self-contained ONNX runtime with a PyTorch-shaped API for inference and training.

The .whl is less than 20MB. GPU execution uses Burn/CubeCL + wgpu enabling it to run across OSes and GPUs, without requiring any extra libraries.

``` bash
    $ pip install tynx
```

And API

``` python
    import tynx as tx
    model = tx.nn.Sequential(
      tx.nn.Linear(8, 16), 
      tx.nn.ReLU(), 
      tx.nn.Linear(16, 2)
    )

    optimizer = tx.optim.Adam(model.parameters(), lr=1e-3)

    loss = tx.nn.functional.cross_entropy(model(x), target)
    loss.backward()
    optimizer.step()
```

The runtime is written in Rust, and also can compile to the browser(PoC done).It’s early, I'd love for feedback and possible use cases & API expansion where this could be beneficial.

Comments URL: [https://news.ycombinator.com/item?id=49268144](https://news.ycombinator.com/item?id=49268144)

Points: 1

# Comments: 0
