|
25 | 25 | </a> |
26 | 26 | </p> |
27 | 27 |
|
28 | | -## Table of Contents |
29 | | - |
30 | | -- [Overview](#overview) |
31 | | -- [Quick Setup](#quick-setup) |
32 | | -- [REPL Environments](#repl-environments) |
33 | | - - [Local Environments](#local-environments) |
34 | | - - [Docker](#docker-img-srcgithubcomdockerpng-altdocker-height20-stylevertical-align-middle-requires-docker-installed) |
35 | | - - [Isolated Environments](#isolated-environments) |
36 | | - - [Modal Sandboxes](#modal-sandboxes-img-srcgithubcommodal-labspng-altmodal-height20-stylevertical-align-middle) |
37 | | - - [Prime Intellect Sandboxes](#prime-intellect-sandboxes-img-srcgithubcomprimeintellect-aipng-altprime-intellect-height20-stylevertical-align-middle) |
38 | | -- [Model Providers](#model-providers) |
39 | | -- [Relevant Reading](#relevant-reading) |
40 | | -- [Optional Debugging: Visualizing RLM Trajectories](#optional-debugging-visualizing-rlm-trajectories) |
41 | | - |
42 | 28 | ## Overview |
43 | 29 | Recursive Language Models (RLMs) are a task-agnostic inference paradigm for language models (LMs) to handle near-infinite length contexts by enabling the LM to *programmatically* examine, decompose, and recursively call itself over its input. RLMs replace the canonical `llm.completion(prompt, model)` call with a `rlm.completion(prompt, model)` call. RLMs offload the context as a variable in a REPL environment that the LM can interact with and launch sub-LM calls inside of. |
44 | 30 |
|
@@ -70,16 +56,16 @@ The default RLM object uses a REPL environment that runs on the host process thr |
70 | 56 | from rlm import RLM |
71 | 57 |
|
72 | 58 | rlm = RLM( |
73 | | - backend="portkey", |
74 | | - backend_kwargs={"model_name": "@openai/gpt-5-nano"}, |
| 59 | + backend="openai", |
| 60 | + backend_kwargs={"model_name": "gpt-5-nano"}, |
75 | 61 | verbose=True, # For printing to console with rich, disabled by default. |
76 | 62 | ) |
77 | 63 |
|
78 | 64 | print(rlm.completion("Print me the first 100 powers of two, each on a newline.").response) |
79 | 65 | ``` |
80 | 66 |
|
81 | 67 | ## REPL Environments |
82 | | -We support two types of REPL environments -- isolated, and non-isolated. Non-isolated environments (default) run code execution on the same machine as the RLM (e.g. through `exec`), which is relatively safe but can potentially be problematic. Fully isolated environments used Cloud-based sandboxes (e.g. Prime Sandboxes, [Modal Sandboxes](https://modal.com/docs/guide/sandboxes)) to run code generated by the RLM, ensuring completely isolation from the host process. Environments can be added, but we natively support the following: `local` (default), `modal`, `prime`. |
| 68 | +We support two types of REPL environments -- isolated, and non-isolated. Non-isolated environments (default) run code execution on the same machine as the RLM (e.g. through `exec`), which is pretty reasonable for some local low-risk tasks, like simple benchmarking, but can be problematic if the prompts or tool calls can interact with malicious users. Fully isolated environments used Cloud-based sandboxes (e.g. Prime Sandboxes, [Modal Sandboxes](https://modal.com/docs/guide/sandboxes)) to run code generated by the RLM, ensuring completely isolation from the host process. Environments can be added, but we natively support the following: `local` (default), `modal`, `prime`. |
83 | 69 |
|
84 | 70 | ```python |
85 | 71 | rlm = RLM( |
|
0 commit comments