Skip to main content

Minimal RL in Rust

Project description

TwisteRL

TwisteRL

A minimalistic, high-performance Reinforcement Learning framework implemented in Rust.

The current version is a Proof of Concept, stay tuned for future releases!

Install

pip install .

Use

Training

python -m twisterl.train --config examples/ppo_puzzle8_v1.json

This example trains a model to play the popular "8 puzzle":

|8|7|5|
|3|2| |
|4|6|1|

where numbers have to be shifted around through the empty slot until they are in order.

This model can be trained on a single CPU in under 1 minute (no GPU required!). A larger version (4x4) is available: examples/ppo_puzzle15_v1.json.

Inference

Check the notebook example here!

🚀 Key Features

  • High-Performance Core: RL episode loop implemented in Rust for faster training and inference
  • Inference-Ready: Easy compilation and bundling of models with environments into portable binaries for inference
  • Modular Design: Support for multiple algorithms (PPO, AlphaZero) with interchangeable training and inference
  • Language Interoperability: Core in Rust with Python interface

🏗️ Current State (PoC)

  • Hybrid rust-python implementation:
    • Data collection and inference in Rust
    • Training in Python (PyTorch)
  • Supported algorithms:
    • PPO (Proximal Policy Optimization)
    • AlphaZero
  • Focus on discrete observation and action spaces
  • Support for native Rust environments and for Python environments through a wrapper

🚧 Roadmap

Upcoming Features (Alpha Version)

  • Full training in Rust
  • Extended support for:
    • Continuous observation spaces
    • Continuous action spaces
    • Custom policy architectures
  • Native WebAssembly environment support
  • Streamlined policy+environment bundle export to WebAssembly
  • Comprehensive Python interface
  • Enhanced documentation and test coverage

💎 Future Possibilities

  • WebAssembly environment repository
  • Browser-based environment and agent visualization
  • Interactive web demonstrations
  • Serverless distributed training

🎮 Use Cases

Currently used in:

Perfect for:

  • Puzzle-like optimization problems
  • Any scenario requiring fast, production performance RL inference

🔧 Current Limitations

  • Limited to discrete observation and action spaces
  • Python environments may create performance bottlenecks
  • Documentation and testing coverage is currently minimal
  • WebAssembly support is in development

🤝 Contributing

We're in early development stages and welcome contributions! Stay tuned for more detailed contribution guidelines.

📄 Note

This project is currently in PoC stage. While functional, it's under active development and the API may change significantly.

📜 License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

twisterl-0.1.0-cp312-cp312-win_amd64.whl (306.2 kB view details)

Uploaded CPython 3.12Windows x86-64

twisterl-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl (448.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

twisterl-0.1.0-cp312-cp312-macosx_11_0_arm64.whl (396.1 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

twisterl-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl (415.4 kB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

twisterl-0.1.0-cp311-cp311-win_amd64.whl (305.6 kB view details)

Uploaded CPython 3.11Windows x86-64

twisterl-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl (449.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

twisterl-0.1.0-cp311-cp311-macosx_11_0_arm64.whl (399.9 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

twisterl-0.1.0-cp311-cp311-macosx_10_12_x86_64.whl (420.0 kB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

twisterl-0.1.0-cp310-cp310-win_amd64.whl (305.6 kB view details)

Uploaded CPython 3.10Windows x86-64

twisterl-0.1.0-cp310-cp310-manylinux_2_34_x86_64.whl (450.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

twisterl-0.1.0-cp310-cp310-macosx_11_0_arm64.whl (399.8 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

twisterl-0.1.0-cp310-cp310-macosx_10_12_x86_64.whl (419.6 kB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

twisterl-0.1.0-cp39-cp39-win_amd64.whl (308.2 kB view details)

Uploaded CPython 3.9Windows x86-64

twisterl-0.1.0-cp39-cp39-manylinux_2_34_x86_64.whl (450.5 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

twisterl-0.1.0-cp39-cp39-macosx_11_0_arm64.whl (400.6 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

twisterl-0.1.0-cp39-cp39-macosx_10_12_x86_64.whl (420.3 kB view details)

Uploaded CPython 3.9macOS 10.12+ x86-64

File details

Details for the file twisterl-0.1.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: twisterl-0.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 306.2 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for twisterl-0.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 68469679ae7da16bdb0ded83ec37072c29bc359b4556cd80f4a64a9bf5ba40e0
MD5 a7d01b11895e88520d617277d0a8320a
BLAKE2b-256 39a6ab0354405d9d2fc14f6b44781c623299caf6e9a2181b86a94a02da3ab586

See more details on using hashes here.

File details

Details for the file twisterl-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for twisterl-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 80bd6a61ad5286a4a41946e4311a02aae4876061c4f52f289310a2b174757df3
MD5 880c15a37eee0a377907de4b4a34e018
BLAKE2b-256 23fdf03de249759351f8fdc0101d72f9064c5f6c3ecaab7ca98bf3d71387e81e

See more details on using hashes here.

File details

Details for the file twisterl-0.1.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for twisterl-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8a0bab3f37a05363711c9d97ee9668eaefa4dab488ede79edb3e83c0756fc9ce
MD5 1ad5e7e83435bfe40ab393d6d1686c11
BLAKE2b-256 844192a6def45145833ea6a325d02fe1a43bc4039e8708a235951338081e429e

See more details on using hashes here.

File details

Details for the file twisterl-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for twisterl-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ddaf88a892595baf14546458f7a615e841209b2de5f8b94b0b825d7b6248503a
MD5 2a4eee0bc4d87507a5d75cd042a97d12
BLAKE2b-256 e679fdc114f67275e4a654f6bfe2f7465d494e5ef0f3a46b73b6429ed5a7dd75

See more details on using hashes here.

File details

Details for the file twisterl-0.1.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: twisterl-0.1.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 305.6 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for twisterl-0.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d6311956814514ac6bee3f37ef07fc217de6750b754cea347194e19f29992d04
MD5 c7cefc274aec6c3a142dd6dc033e1d06
BLAKE2b-256 8025fe05d1279fbd1851b7dc6d0681064a68c00c9804ca2c5bd92fb2a088e3ac

See more details on using hashes here.

File details

Details for the file twisterl-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for twisterl-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 06fdcedfefab45d359f8cd5d29ecad6420f4416361ffc9a584ee8fa453e7ded2
MD5 1ef9591bbf530f6f184041ff2464331b
BLAKE2b-256 a57ec3a1bdeb3b2ec77908bf3b7682488338f7f99bdaebc3edac43039b4b3ef1

See more details on using hashes here.

File details

Details for the file twisterl-0.1.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for twisterl-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 992d876549bc0635c919b477c1d5dd84eafee0e5ad999a7a887d6d0c8569dded
MD5 6101e304a7c982681739dd434efc0f09
BLAKE2b-256 b8bbb82c945bcb2896d8c25c2099042bf4f81fb4c1b943b54cd272ed1d126aa2

See more details on using hashes here.

File details

Details for the file twisterl-0.1.0-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for twisterl-0.1.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 be5ce052da1ae5e70ed64b096a819431878b320446908625a09301ae07ccbb1a
MD5 db2dc3e93b56e1d2945ed634dc103d88
BLAKE2b-256 9b74ca2aa1666970dbf15d1a6460d393d1d31a431e0e82f61ecaa61d43b39fac

See more details on using hashes here.

File details

Details for the file twisterl-0.1.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: twisterl-0.1.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 305.6 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for twisterl-0.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 66d0fe15295b6d4bb2a0591d76ff904266630b3e260342a837fe7b3f6f09e621
MD5 b07a931e91c908d938e7b5566f87b7d0
BLAKE2b-256 725946d80629cb53b1f9f64d532900ca0919d86e8d1bfc4cc6dd64396f17d580

See more details on using hashes here.

File details

Details for the file twisterl-0.1.0-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for twisterl-0.1.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 e24fbbdbb8d82648a461c61eb8834b1cc619ad3f1c9e1abb2fa39a99b1e5d318
MD5 3a2365558cb4a62d0b913b1192317314
BLAKE2b-256 839f84ba5922263d9a3c8bd7270cdedc74ba2f7aaabeab7ffa2020615f1ef494

See more details on using hashes here.

File details

Details for the file twisterl-0.1.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for twisterl-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dc0ed9e5b0bdb044bc83cb3db1737e1b3603f0dbfa5e287ac8244d5ed70a50ad
MD5 0230c79a95e3575b8c2912d1526811cc
BLAKE2b-256 00ba80c5099e163b459a8f9f4699f358d40dce4c7ad7b57102e26242f9446365

See more details on using hashes here.

File details

Details for the file twisterl-0.1.0-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for twisterl-0.1.0-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 955ef9c54323abaf2230771926f812b9c10fdb5edb939b48ba307d63a5142e9a
MD5 5af482efcfb1e4844cfab87d6591d436
BLAKE2b-256 e177ba5a6a39ec5c1bda5d88e535168881b0d87cb53c323d3c1c8bfc597fdac4

See more details on using hashes here.

File details

Details for the file twisterl-0.1.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: twisterl-0.1.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 308.2 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.13

File hashes

Hashes for twisterl-0.1.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 9f1af20e599045ed772adc4167d7bbed9d65ad74e18bb83f38dbfd906cb046e4
MD5 ca563c8e5a42550bb2fcaf86e2fdc707
BLAKE2b-256 c1a99ee3c64afe7e536c3fcfbeff1e4d3bbe6751d10052734cbba1f7363b4eba

See more details on using hashes here.

File details

Details for the file twisterl-0.1.0-cp39-cp39-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for twisterl-0.1.0-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 83a2a8494f590017ab91797af104ebeb1993ff361dfa89749fe0179b48b7c212
MD5 3dfeef465b6e3da843f469bc2a7c3766
BLAKE2b-256 b02ec9557f1b5e81598bcd3f5b5c31c2dd0e50de9fcc31ac52e73f374546a2ec

See more details on using hashes here.

File details

Details for the file twisterl-0.1.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for twisterl-0.1.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f43c019f4373a63f3c1cb86ee4f58ed476c06fdeaa0f98cb4beac91c6c1f9e82
MD5 57cad0bb234c915d4d09504fb7f4f448
BLAKE2b-256 d5a02750da58225f9bcc5e1de40dc20bfdd184fc80a33b08f5aeb3b351760641

See more details on using hashes here.

File details

Details for the file twisterl-0.1.0-cp39-cp39-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for twisterl-0.1.0-cp39-cp39-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 1405cab8a5abaf1336e968edc89a8a08ede7f7942edde43465c5f19079bc25ac
MD5 4d76af8f7e5e47242a0c601b6b2dd158
BLAKE2b-256 a71261988587c70be0e2bdfc5865d342c3c8fa4cbb0fdc862a79142a89d94eed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page