XR

xiaoconstantine/rlm-go

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

21 stars 品質 54 トレンド 14MIT

Go implementation of Recursive Language Models (RLM) - inference-time scaling for arbitrarily long contexts

概要

A Go implementation of Recursive Language Models (RLM) - an inference-time scaling strategy that enables LLMs to handle arbitrarily long contexts by treating prompts as external objects that can be programmatically examined and recursively processed. RLM-go provides a Go REPL environment where LLM-generated code can: - Access context stored as a variable - Make recursive sub-LLM calls via Query() and QueryBatched() - Use standard Go operations for text processing - Signal completion with FINAL() or FINAL_VAR() Unlike the Python RLM which uses socket IPC, rlm-go uses via Yaegi - a Go interpreter. This eliminates: - Socket server overhead - Serialization/deserialization - Process boundaries The result is ~100x less latency per sub-LLM call compared to socket IPC. - Go 1.

README

以下は原文 README の抜粋です。原文を見る。

rlm-go

A Go implementation of Recursive Language Models (RLM) - an inference-time scaling strategy that enables LLMs to handle arbitrarily long contexts by treating prompts as external objects that can be programmatically examined and recursively processed.

Overview

RLM-go provides a Go REPL environment where LLM-generated code can:

  • Access context stored as a variable
  • Make recursive sub-LLM calls via Query() and QueryBatched()
  • Use standard Go operations for text processing
  • Signal completion with FINAL() or FINAL_VAR()

Key Design Decisions

Unlike the Python RLM which uses socket IPC, rlm-go uses direct function injection via Yaegi - a Go interpreter. This eliminates:

  • Socket server overhead
  • Serialization/deserialization
  • Process boundaries

The result is ~100x less latency per sub-LLM call compared to socket IPC.

Requirements

  • Go 1.23 or later (for building from source)
  • An LLM API key:
    • ANTHROPIC_API_KEY for Claude models (default)
    • GEMINI_API_KEY for Gemini models
    • OPENAI_API_KEY for OpenAI models
  • (Optional) Podman or Docker for isolated sandbox execution

Supported Models

Provider Models Env Variable
Anthropic claude-sonnet-4-20250514, claude-opus-4-20250514, etc. ANTHROPIC_API_KEY
Google gemini-3-flash-preview, gemini-3-pro-preview GEMINI_API_KEY
OpenAI gpt-5, gpt-5-mini OPENAI_API_KEY

The provider is auto-detected based on model name. Anthropic is the default.

Installation

# Download and install the latest release
curl -fsSL https://raw.githubusercontent.com/XiaoConstantine/rlm-go/main/install.sh | bash

This installs the rlm binary to ~/.local/bin/rlm.

Go Install

go install github.com/XiaoConstantine/rlm-go/cmd/rlm@latest

From Source

git clone https://github.com/XiaoConstantine/rlm-go.git
cd rlm-go
go build -o rlm ./cmd/rlm

As a Library

go get github.com/XiaoConstantine/rlm-go

Claude Code Integration

RLM includes a skill for Claude Code that provides documentation and usage guidance for large context processing.

Install the Skill

rlm install-claude-code

This creates a skill at ~/.claude/skills/rlm/SKILL.md that teaches Claude Code:

  • When to use RLM (contexts >50KB, token efficiency needed)
  • Command usage and options
GitHub で README 全文を見る

推奨ツール

別のキーワードを試すか、フィルタを外してください。

インストール

npx skillfish add xiaoconstantine/rlm-go
MCP 初心者?mcpskill.org のガイドから始めましょう →