{"slug": "show-hn-tynx-train-onnx-models-with-a-pytorch-shaped-api-20-mb-whl", "title": "Show HN: Tynx - train ONNX models with a PyTorch-shaped API (<20 MB whl)", "summary": "Tynx, a new ONNX runtime with a PyTorch-shaped API for inference and training, has been released as a Python package under 20 MB. Written in Rust, it uses Burn/CubeCL and wgpu for GPU execution across operating systems and GPUs without extra libraries, and can compile to the browser. The project is early-stage, seeking feedback and use cases.", "body_md": "Tynx is a small, self-contained ONNX runtime with a PyTorch-shaped API for inference and training.\n\nThe .whl is less than 20MB. GPU execution uses Burn/CubeCL + wgpu enabling it to run across OSes and GPUs, without requiring any extra libraries.\n\n``` bash\n    $ pip install tynx\n```\n\nAnd API\n\n``` python\n    import tynx as tx\n    model = tx.nn.Sequential(\n      tx.nn.Linear(8, 16), \n      tx.nn.ReLU(), \n      tx.nn.Linear(16, 2)\n    )\n\n    optimizer = tx.optim.Adam(model.parameters(), lr=1e-3)\n\n    loss = tx.nn.functional.cross_entropy(model(x), target)\n    loss.backward()\n    optimizer.step()\n```\n\nThe 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.\n\nComments URL: [https://news.ycombinator.com/item?id=49268144](https://news.ycombinator.com/item?id=49268144)\n\nPoints: 1\n\n# Comments: 0", "url": "https://wpnews.pro/news/show-hn-tynx-train-onnx-models-with-a-pytorch-shaped-api-20-mb-whl", "canonical_source": "https://github.com/blaind/tynx/", "published_at": "2026-08-12 05:31:36+00:00", "updated_at": "2026-08-12 05:40:22.427638+00:00", "lang": "en", "topics": ["machine-learning", "developer-tools", "ai-infrastructure"], "entities": ["Tynx", "ONNX", "PyTorch", "Burn", "CubeCL", "wgpu", "Rust"], "alternates": {"html": "https://wpnews.pro/news/show-hn-tynx-train-onnx-models-with-a-pytorch-shaped-api-20-mb-whl", "markdown": "https://wpnews.pro/news/show-hn-tynx-train-onnx-models-with-a-pytorch-shaped-api-20-mb-whl.md", "text": "https://wpnews.pro/news/show-hn-tynx-train-onnx-models-with-a-pytorch-shaped-api-20-mb-whl.txt", "jsonld": "https://wpnews.pro/news/show-hn-tynx-train-onnx-models-with-a-pytorch-shaped-api-20-mb-whl.jsonld"}}