Skip to content
Radiant LabsRadiant Labs

Getting started

Installation

Install Rust and create a project pinned to the documented public Polaris revision.

Install Rust with rustup and a native linker for your operating system. The public revision documented here requires Rust 1.97.0 or newer (Edition 2024).

Terminal window
rustup toolchain install 1.97.0 --profile minimal
rustc +1.97.0 --version

The first graph needs no model credentials. The optional model example uses an Anthropic API key and makes a billable API request.

Terminal window
cargo +1.97.0 new hello-polaris
cd hello-polaris
rustup override set 1.97.0

Replace the generated Cargo.toml with:

[package]
name = "hello-polaris"
version = "0.1.0"
edition = "2024"
[dependencies]
polaris-ai = { git = "https://github.com/RadiantAILabs/polaris", rev = "5ff84646db63589d58bf87956976d749b8c754de" }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }

The rev value pins the framework to the exact public Git commit tested with these examples. It prevents later API changes from breaking the tutorial. It does not restrict which model you can call.

The Cargo package is polaris-ai; the Rust import is polaris_ai. The repository examples alias that dependency as polaris, which is why their imports look different.

Run cargo check, then continue to Your first agent for the complete src/main.rs.

Enable only the providers your application uses. For the Anthropic example, add a feature to the same dependency:

polaris-ai = { git = "https://github.com/RadiantAILabs/polaris", rev = "5ff84646db63589d58bf87956976d749b8c754de", features = ["anthropic"] }

Other provider features include openai and bedrock. otel enables OpenTelemetry export. Feature flags select compiled capabilities; you must still add the corresponding plugins to your server.

cargo add polaris-ai selects a crates.io release. If you choose that route, use the API reference for the selected release and check its Rust requirement. Do not assume its API matches the Git revision used in these guides. Commit Cargo.lock for applications so dependency resolution is reproducible.

  • Rust version too old: check rustc --version inside the project. A directory override can differ from your global default.
  • Cannot find tokio or its main macro: keep both Tokio features shown above.
  • Provider import is unavailable: enable the matching Cargo feature; adding an API key alone cannot enable it.