# Installation

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

## Prerequisites

Install [Rust with rustup](https://rustup.rs/) and a native linker for your operating system. The public revision documented here requires **Rust 1.97.0 or newer** (Edition 2024).

```sh
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.

## Create a project

```sh
cargo +1.97.0 new hello-polaris
cd hello-polaris
rustup override set 1.97.0
```

Replace the generated `Cargo.toml` with:

```toml
[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](/docs/polaris/getting-started/your-first-agent.md) for the complete `src/main.rs`.

## Model provider features

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

```toml
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.

## Published releases

`cargo add polaris-ai` selects a crates.io release. If you choose that route, use the [API reference for the selected release](https://docs.rs/polaris-ai) 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.

## Common setup problems

* **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.
