r2ai  by radareorg

Local language model for reverse engineering with radare2

Created 2 years ago
332 stars

Top 82.4% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides a local, conversational AI assistant for reverse engineering tasks, primarily integrated with the radare2 framework. It empowers reverse engineers and security researchers by enabling natural language queries about code, binaries, and general reverse engineering concepts, potentially reducing reliance on external services and improving workflow efficiency.

How It Works

r2ai leverages local or remote Large Language Models (LLMs) to process natural language prompts. It integrates with radare2 via a native C plugin or a JavaScript plugin (decai), allowing users to query the AI directly from the radare2 shell. The system supports various LLM backends (Ollama, OpenAI, Anthropic, etc.) and can index large codebases or documentation using vector databases for context-aware responses.

Quick Start & Requirements

  • Installation: Recommended via r2pm (e.g., r2pm -s r2ai). Alternatively, build from source using make in subdirectories (src/, py/, decai/, server/).
  • Prerequisites: Radare2, Python (for py/ components), potentially CUDA-enabled GPU for local LLMs. API keys for remote services are stored in ~/.r2ai.<provider>-key.
  • Usage: Launch from radare2 shell with r2 -qc r2ai-r or via r2pm -r r2ai.
  • Documentation: https://github.com/radareorg/r2ai

Highlighted Details

  • Supports auto-solving tasks using function calling.
  • Can index large codebases or markdown books using vector databases.
  • Offers a native C plugin for radare2 (r2ai-plugin) and a JS plugin (decai) focused on decompilation.
  • Supports multiple LLM providers including OpenAI, Anthropic, Ollama, and local models via llamafile, llamacpp, etc.

Maintenance & Community

  • Developed by radareorg, a well-established community in reverse engineering tools.
  • Community interaction likely via radareorg's existing channels (e.g., Discord, mailing lists).

Licensing & Compatibility

  • The repository appears to have a mix of licenses, with the core C plugin likely under a permissive license (similar to radare2 itself), while Python components might have different terms. Further clarification on specific sub-project licenses is recommended for commercial use.

Limitations & Caveats

The project notes that models used by r2ai may provide unreliable information, and there's an ongoing effort to improve post-finetuning. Some components are marked as deprecated (e.g., r2ai-python CLI).

Health Check
Last Commit

3 days ago

Responsiveness

Inactive

Pull Requests (30d)
12
Issues (30d)
6
Star History
25 stars in the last 30 days

Explore Similar Projects

Starred by Boris Cherny Boris Cherny(Creator of Claude Code; MTS at Anthropic), Nat Friedman Nat Friedman(Former CEO of GitHub), and
40 more.

aider by Aider-AI

0.3%
38k
AI pair programming in your terminal
Created 2 years ago
Updated 2 days ago
Feedback? Help us improve.