Skip to main content

No project description provided

Project description

TRL-ENV

TRL is a convenient library to train large language model (LLM) using reinforcement learning (RL). However, it is still too new, the interface is not well-developed yet. rollout_func is a low-level interface to write your own rollout for RL and environment_factory is a high-level interface to train your model with external environemnt, however, how it parse the model output for tool use is uncleared and not documented.

TRL-ENV addresses the middle-level with a very simple environment interface

type Action = str
type Delta = str
type Seed = str

class Env(Protocol):
    last_step_reward: float
    alive: bool
    def reset(self, seed: Seed) -> Delta: ...
    def step(self, action: Action) -> Delta: ...

It is similar to tool call if not the same. Moreover, transformers despite after 8 years of development (as of 2026) is still not stable. For example, not all models has Tokenizer.parse_response which should be a basic function that must be implemented from the beginning. TRL-ENV requires Tokenizer.parse_response to be existed by Processor interface

Language = str

class Processor(Protocol):
    def init_system_input(self, prompt: Language) -> str: ...
    def append_user_input(self, prompt: Language) -> str: ...
    def parse_agent_output(self, completion: Language) -> tuple[str, str]: ...

TRL-ENV also provide a very simple agentic LLM interface. Training code is about 200 lines. See examples

Project details


Download files

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

Source Distribution

trl_env-0.1.1.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

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

trl_env-0.1.1-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file trl_env-0.1.1.tar.gz.

File metadata

  • Download URL: trl_env-0.1.1.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for trl_env-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b522adc6aeaedadba9f50f1713e9c4b0a6005401f3ecf1500c8ecd7da9b6b092
MD5 03e3d06421ada4a44c0c203cbfce56d7
BLAKE2b-256 7e8751ece7fbf22d0630a2158ddda04415a23064361131ccef3d9a7c8a03cff9

See more details on using hashes here.

File details

Details for the file trl_env-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: trl_env-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for trl_env-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8c663eb021010abf7ccc64507b4851eb8c4c6b0f16bf22e29f90c4a0c4e5e466
MD5 e900128e4f63d1005e989f363f52bb3d
BLAKE2b-256 d33b3ea6c6b9ab4019305380dde8edc5c66825555b8115da61c2e0e1fb1c5eaf

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