Skip to content

Installation

Prerequisites

  • Rust 1.70+ - Install Rust
  • Cargo - Comes with Rust installation
  • A modern C compiler (for some dependencies)

Setup Steps

1. Clone the Repository

Bash
git clone https://github.com/coohom/optillm-rs.git
cd optillm-rs

2. Verify Installation

Bash
cargo --version  # Verify Rust is installed
rustc --version # Check Rust version (1.70+)

Using as a Dependency

Add to your Cargo.toml:

TOML
[dependencies]
optillm-core = { path = "path/to/optillm-rs/crates/core" }
optillm-mars = { path = "path/to/optillm-rs/crates/mars" }

Or if published to crates.io:

TOML
[dependencies]
optillm-core = "0.1"
optillm-mars = "0.1"

Building

Build All Crates

Bash
cargo build --release

Build Specific Crate

Bash
cargo build -p optillm-mars --release
cargo build -p optillm-core --release

Development Build (Faster)

Bash
cargo build        # Debug build, faster compilation
cargo build --dev  # Explicit development profile

Verification

Check that everything builds correctly:

Bash
cargo check --all

Run tests to verify functionality:

Bash
cargo test --all

Troubleshooting

Rust Version Issues

If you see errors about Rust version, update Rust:

Bash
rustup update
rustc --version  # Should be 1.70+

Dependency Resolution

If you encounter dependency conflicts:

Bash
cargo update
cargo clean
cargo build

Platform-Specific Issues

macOS with Apple Silicon

Some dependencies may need compilation from source. Install Xcode Command Line Tools:

Bash
xcode-select --install

Linux

Ensure you have the necessary build tools:

Bash
# Ubuntu/Debian
sudo apt-get install build-essential

# Fedora
sudo dnf install gcc gcc-c++ make

Windows

Visual Studio Build Tools or MinGW are required. The Rust installer usually handles this.

Next Steps

Docker Setup (Optional)

For containerized development:

Bash
docker build -t optillm-rs .
docker run -it optillm-rs bash

IDE Setup

VS Code

  1. Install Rust Analyzer
  2. Install CodeLLDB for debugging
  3. Create .vscode/settings.json:
JSON
{
  "[rust]": {
    "editor.defaultFormatter": "rust-lang.rust-analyzer",
    "editor.formatOnSave": true
  }
}

IntelliJ IDEA / CLion

  1. Install the official Rust plugin
  2. Configure Rust toolchain in IDE settings
  3. Enable code inspections

System Requirements

Component Requirement
Rust 1.70+
Cargo Latest stable
RAM 2GB minimum (4GB+ recommended)
Disk 2GB for build artifacts
OS Linux, macOS, Windows

Getting Help