r2ai  by radareorg

Local language model for reverse engineering with radare2

created 1 year ago
291 stars

Top 91.7% 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

4 days ago

Responsiveness

1 day

Pull Requests (30d)
1
Issues (30d)
0
Star History
23 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.