Skip to main content

rlx_text/
lib.rs

1// RLX — versatile ML compiler + runtime.
2// Copyright (C) 2026 Eugene Hauptmann, Nataliya Kosmyna.
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, version 3.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU General Public License for more details.
12//
13// You should have received a copy of the GNU General Public License
14// along with this program. If not, see <https://www.gnu.org/licenses/>.
15
16//! RLX text: tokenizer + chat template + sampling helpers.
17//!
18//! Promoted from `rlx-models/crates/rlx-cli` so that downstream LM apps
19//! (server, web playground, training tools) have one published crate to
20//! depend on without taking the CLI helper layer.
21
22pub mod chat;
23pub mod sampling;
24pub mod tokenizer;
25
26pub use chat::{ChatMessage, ChatTemplate, ChatTemplateSource, auto_chat_template};
27pub use rlx_runtime::SampleOpts;
28pub use sampling::{argmax, sample_next};
29pub use tokenizer::{TokenizerHandle, decode_ids, load_tokenizer};