paladin-ai 0.4.3

Enterprise AI orchestration framework with multi-agent coordination patterns
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
# Installation Guide

This guide provides detailed installation instructions for Paladin on Linux, macOS, and Windows.

## Prerequisites

### Required

- **Rust 1.70 or later**: [https://rustup.rs/]https://rustup.rs/
- **Cargo**: Included with Rust installation
- **LLM API Key**: OpenAI, DeepSeek, or Anthropic account

### Optional

- **Docker**: For containerized deployment (see [Docker Guide]deployment/docker.md)
- **Redis**: For async queue functionality (see [Development Setup]#development-setup)
- **MinIO**: For file storage (see [Development Setup]#development-setup)

## Platform-Specific Setup

### Linux

#### Ubuntu/Debian

```bash
# Install Rust (if not already installed)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env

# Install system dependencies
sudo apt-get update
sudo apt-get install -y build-essential pkg-config libssl-dev

# Verify installation
rustc --version
cargo --version
```

#### Fedora/RHEL/CentOS

```bash
# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env

# Install system dependencies
sudo dnf install -y gcc pkg-config openssl-devel

# Verify installation
rustc --version
cargo --version
```

#### Arch Linux

```bash
# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env

# Install system dependencies
sudo pacman -S base-devel openssl pkg-config

# Verify installation
rustc --version
cargo --version
```

### macOS

#### Using Homebrew

```bash
# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env

# Install OpenSSL (if needed)
brew install openssl pkg-config

# Verify installation
rustc --version
cargo --version
```

#### Apple Silicon (M1/M2/M3)

Rust supports Apple Silicon natively. No additional steps required:

```bash
# Verify architecture
rustc --version --verbose | grep host
# Should show: host: aarch64-apple-darwin
```

### Windows

#### Using rustup-init.exe

1. Download rustup-init.exe from [https://rustup.rs/]https://rustup.rs/
2. Run the installer and follow prompts
3. Restart your terminal

```powershell
# Verify installation
rustc --version
cargo --version
```

#### Using WSL2 (Recommended for Development)

```bash
# Inside WSL2 Ubuntu
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env

# Install dependencies
sudo apt-get update
sudo apt-get install -y build-essential pkg-config libssl-dev

# Verify installation
rustc --version
cargo --version
```

## Installing Paladin

### Option 1: From Crates.io (Stable)

```bash
# Add Paladin to your project
cargo add paladin

# Or manually edit Cargo.toml
```

```toml
[dependencies]
paladin = "0.1"
tokio = { version = "1", features = ["full"] }
```

### Option 2: From Source (Latest)

```bash
# Clone the repository
git clone https://github.com/DF3NDR/paladin-dev-env.git
cd paladin-dev-env

# Build the project
cargo build --release

# Run tests to verify
cargo test

# Optionally install CLI tools
cargo install --path .
```

### Option 3: As a Dependency from Git

```toml
[dependencies]
paladin = { git = "https://github.com/DF3NDR/paladin-dev-env", branch = "main" }
tokio = { version = "1", features = ["full"] }
```

## Feature Flags

Paladin supports optional features that can be enabled in `Cargo.toml`:

```toml
[dependencies.paladin]
version = "0.1"
features = [
    "redis-queue",      # Enable Redis queue adapter (default)
    "s3-storage",       # Enable MinIO/S3 storage (default)
    "anthropic",        # Enable Anthropic LLM provider
    "deepseek",         # Enable DeepSeek LLM provider
    "mcp",              # Enable MCP tool protocol
]
```

### Default Features

Enabled by default:
- `redis-queue` - Redis-based async queue
- `s3-storage` - MinIO/S3 file storage

### Optional Features

Not enabled by default:
- `anthropic` - Anthropic Claude integration
- `deepseek` - DeepSeek LLM integration
- `mcp` - Model Context Protocol for tools

Disable default features:

```toml
[dependencies.paladin]
version = "0.1"
default-features = false
features = ["mcp"]  # Only enable MCP
```

## Environment Configuration

### API Keys

Create a `.env` file in your project root:

```bash
# OpenAI (default provider)
OPENAI_API_KEY=sk-your-api-key-here
OPENAI_BASE_URL=https://api.openai.com/v1  # Optional

# DeepSeek
DEEPSEEK_API_KEY=your-deepseek-key
DEEPSEEK_BASE_URL=https://api.deepseek.com/v1  # Optional

# Anthropic
ANTHROPIC_API_KEY=your-anthropic-key
ANTHROPIC_BASE_URL=https://api.anthropic.com/v1  # Optional
```

### Configuration File

Create `config.yml` (optional):

```yaml
paladin:
  default_model: "gpt-4"
  default_temperature: 0.7
  default_max_loops: 3
  timeout_seconds: 300

garrison:
  type: "sqlite"  # or "in_memory"
  path: "./garrison.db"
  max_entries: 1000

llm:
  openai:
    api_key: "${OPENAI_API_KEY}"
    base_url: "https://api.openai.com/v1"
```

## Development Setup

For local development with all features:

### 1. Clone the Repository

```bash
git clone https://github.com/DF3NDR/paladin-dev-env.git
cd paladin-dev-env
```

### 2. Install Development Dependencies

```bash
# Install additional cargo tools
cargo install cargo-watch      # Auto-rebuild on changes
cargo install cargo-edit        # cargo add/rm commands
cargo install cargo-audit       # Security vulnerability scanning
cargo install cargo-llvm-cov    # Code coverage
cargo install cargo-insta       # Snapshot testing (for CLI output tests)
```

**cargo-insta** is used for CLI snapshot testing. It allows you to capture and verify terminal output:

```bash
# Run snapshot tests
cargo test --test cli

# Review new snapshots
cargo insta review

# Accept all pending snapshots
cargo insta accept
```

See [`tests/cli/`](../tests/cli/) for snapshot test examples.

### 3. Start Docker Services (Optional)

```bash
# Start Redis and MinIO
make dev

# Or manually with docker-compose
docker-compose -f docker/docker-compose.dev.yml up -d
```

### 4. Configure Environment

```bash
# Copy example environment
cp .env.example .env

# Edit with your API keys
vim .env
```

### 5. Build and Test

```bash
# Build the project
cargo build

# Run tests
cargo test

# Run with auto-reload
cargo watch -x run
```

## Verification

### Quick Test

Create `test.rs`:

```rust
use paladin::prelude::*;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    println!("Paladin version: {}", env!("CARGO_PKG_VERSION"));
    println!("Installation successful!");
    Ok(())
}
```

Run:

```bash
cargo run --example test
```

### Full System Test

```bash
# Run all tests
cargo test

# Run integration tests (requires Docker services)
make test-integration-docker

# Run benchmarks
cargo bench
```

## Troubleshooting

### OpenSSL Errors (Linux)

```bash
# Ubuntu/Debian
sudo apt-get install pkg-config libssl-dev

# Fedora/RHEL
sudo dnf install pkgconfig openssl-devel

# Arch
sudo pacman -S openssl pkg-config
```

### Linking Errors (Windows)

Install Visual Studio Build Tools:
- Download from [https://visualstudio.microsoft.com/downloads/]https://visualstudio.microsoft.com/downloads/
- Select "Desktop development with C++"

### Permission Errors (macOS)

```bash
# Fix cargo permissions
sudo chown -R $(whoami) ~/.cargo
```

### Slow Compilation

Enable parallel compilation:

```bash
# Add to ~/.cargo/config.toml
[build]
jobs = 8  # Adjust based on CPU cores
```

Use `sccache` for caching:

```bash
cargo install sccache
export RUSTC_WRAPPER=sccache
```

### Network Issues

Use a proxy:

```bash
# Set in ~/.cargo/config.toml
[http]
proxy = "http://proxy.example.com:8080"

[https]
proxy = "http://proxy.example.com:8080"
```

Or use a mirror:

```bash
[source.crates-io]
replace-with = "ustc"

[source.ustc]
registry = "https://mirrors.ustc.edu.cn/crates.io-index"
```

## Next Steps

- **[Quickstart Guide]QUICKSTART.md** - Build your first Paladin agent
- **[Configuration Guide]guides/paladin-configuration.md** - Advanced configuration
- **[Examples]../examples/** - Working code examples
- **[API Reference]https://docs.rs/paladin** - Complete API documentation

## Platform Support

| Platform | Architecture | Status | Notes |
|----------|-------------|--------|-------|
| Linux | x86_64 | ✅ Tested | Primary development platform |
| Linux | aarch64 | ✅ Tested | ARM servers, Raspberry Pi |
| macOS | x86_64 | ✅ Tested | Intel Macs |
| macOS | aarch64 | ✅ Tested | Apple Silicon (M1/M2/M3) |
| Windows | x86_64 | ⚠️ Experimental | WSL2 recommended |
| Windows | aarch64 | ❌ Untested | May work with WSL2 |

## Minimum System Requirements

- **CPU**: 2 cores (4+ recommended for parallel operations)
- **RAM**: 4 GB (8+ GB recommended)
- **Disk**: 2 GB for dependencies and builds
- **Network**: Internet connection for LLM API calls

## Get Help

- **Installation Issues**: [GitHub Issues]https://github.com/DF3NDR/paladin-dev-env/issues
- **General Questions**: [GitHub Discussions]https://github.com/DF3NDR/paladin-dev-env/discussions
- **Documentation**: [docs/]README.md