1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! # librlm
//!
//! Implementation of the Recursive Language Models (RLM) algorithm as described in
//! "Recursive Language Models" (Zhang, Kraska, Khattab — MIT CSAIL, Jan 2026).
//!
//! RLM enables LLMs to handle arbitrarily long prompts by treating them as part of
//! an external environment. The LLM interacts with the prompt through a persistent
//! Lua REPL, writing code to peek at, decompose, and recursively invoke sub-LLMs
//! over manageable chunks.
//!
//! # Quick Start
//!
//! ```rust,no_run
//! use librlm::Rlm;
//!
//! # async fn example() -> Result<(), librlm::RlmError> {
//! let rlm = Rlm::builder()
//! .root_model("gpt-5")
//! .root_api_key("sk-...")
//! .sub_model("gpt-5-mini")
//! .max_iterations(30)
//! .build()?;
//!
//! let result = rlm.completion("very long prompt...", Some("What is X?")).await?;
//! println!("{}", result.response);
//! # Ok(())
//! # }
//! ```
pub use RlmConfig;
pub use RlmError;
pub use ;
pub use ;
pub use ;