Skip to content

Commit 0fadebe

Browse files
committed
Improve initial instructions
1 parent d429111 commit 0fadebe

4 files changed

Lines changed: 110 additions & 9 deletions

File tree

README.md

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,59 @@ An open-source AI Gateway that provides a unified OpenAI-compatible API for rout
1818

1919
## Quick Start
2020

21+
See the [Getting Started](https://hadriangateway.com/docs/getting-started) guide for more details. Otherwise:
22+
23+
Download the latest binary from [GitHub Releases](https://github.com/ScriptSmith/hadrian/releases/latest) and run it:
24+
25+
```bash
26+
./hadrian
27+
```
28+
29+
Or use Docker:
30+
2131
```bash
22-
# Download and run
23-
cargo install hadrian
24-
hadrian
32+
cat <<'EOF' > hadrian.toml
33+
[server]
34+
host = "0.0.0.0"
35+
port = 8080
36+
37+
[database]
38+
type = "sqlite"
39+
path = "/app/data/hadrian.db"
40+
41+
[cache]
42+
type = "memory"
43+
44+
[ui]
45+
enabled = true
46+
47+
# Add a provider (uncomment and set your API key)
48+
# [providers.openai]
49+
# type = "open_ai"
50+
# api_key = "${OPENAI_API_KEY}"
51+
EOF
52+
53+
docker run -p 8080:8080 \
54+
-v ./hadrian.toml:/app/config/hadrian.toml:ro \
55+
-v hadrian-data:/app/data \
56+
ghcr.io/scriptsmith/hadrian
57+
```
58+
59+
Or build from source ([just](https://just.systems) required):
2560

26-
# Or with Docker
27-
docker run -p 8080:8080 ghcr.io/scriptsmith/hadrian
61+
```bash
62+
git clone https://github.com/ScriptSmith/hadrian.git
63+
cd hadrian && just init && just build
64+
./target/release/hadrian
2865
```
2966

30-
The gateway starts at `http://localhost:8080` with the chat UI. No database required for basic use.
67+
Or install from crates.io (find the latest version with `cargo search hadrian`):
68+
69+
```bash
70+
cargo install hadrian@VERSION
71+
```
3172

32-
Running without arguments creates `~/.config/hadrian/hadrian.toml` with sensible defaults, uses SQLite, and opens the browser to the chat UI.
73+
The gateway starts at `http://localhost:8080` with the chat UI. No database required for basic use. Running without arguments creates `~/.config/hadrian/hadrian.toml` with sensible defaults, uses SQLite, and opens the browser.
3374

3475
## Configuration
3576

docs/components/quick-start-selector.tsx

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ const featureMatrix: { name: string; profiles: Profile[] }[] = [
4848
{ name: "Azure OpenAI", profiles: ["minimal", "standard", "full"] },
4949
{ name: "SQLite", profiles: ["minimal", "standard", "full"] },
5050
{ name: "Embedded UI", profiles: ["minimal", "standard", "full"] },
51+
{ name: "Model catalog", profiles: ["minimal", "standard", "full"] },
5152
{ name: "Setup wizard", profiles: ["minimal", "standard", "full"] },
5253
{ name: "PostgreSQL", profiles: ["standard", "full"] },
5354
{ name: "Redis caching", profiles: ["standard", "full"] },
@@ -57,18 +58,44 @@ const featureMatrix: { name: string; profiles: Profile[] }[] = [
5758
{ name: "Secrets managers", profiles: ["standard", "full"] },
5859
{ name: "OTLP & Prometheus", profiles: ["standard", "full"] },
5960
{ name: "OpenAPI docs", profiles: ["standard", "full"] },
61+
{ name: "Embedded docs", profiles: ["standard", "full"] },
6062
{ name: "Doc extraction", profiles: ["standard", "full"] },
63+
{ name: "Cost forecasting", profiles: ["standard", "full"] },
64+
{ name: "CSV export", profiles: ["standard", "full"] },
65+
{ name: "Response validation", profiles: ["standard", "full"] },
66+
{ name: "JSON schema", profiles: ["standard", "full"] },
6167
{ name: "SAML SSO", profiles: ["full"] },
6268
{ name: "Kreuzberg OCR", profiles: ["full"] },
6369
{ name: "ClamAV scanning", profiles: ["full"] },
6470
];
6571

6672
function getInstallCommand(method: Method, os: OS, profile: Profile, libc: Libc): string {
6773
if (method === "docker") {
68-
return ["docker run \\", " -p 8080:8080 \\", " ghcr.io/scriptsmith/hadrian"].join("\n");
74+
return [
75+
"cat <<'EOF' > hadrian.toml",
76+
"[server]",
77+
'host = "0.0.0.0"',
78+
"port = 8080",
79+
"",
80+
"[database]",
81+
'type = "sqlite"',
82+
'path = "/app/data/hadrian.db"',
83+
"",
84+
"[cache]",
85+
'type = "memory"',
86+
"",
87+
"[ui]",
88+
"enabled = true",
89+
"EOF",
90+
"",
91+
"docker run -p 8080:8080 \\",
92+
" -v ./hadrian.toml:/app/config/hadrian.toml:ro \\",
93+
" -v hadrian-data:/app/data \\",
94+
" ghcr.io/scriptsmith/hadrian",
95+
].join("\n");
6996
}
7097
if (method === "cargo") {
71-
return "cargo install hadrian\nhadrian";
98+
return `cargo install hadrian@${process.env.HADRIAN_VERSION}\nhadrian`;
7299
}
73100
const ext = os === "windows" ? "zip" : "tar.gz";
74101
const target = getTarget(os, libc);

docs/next.config.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1+
import { readFileSync } from "node:fs";
12
import { createMDX } from "fumadocs-mdx/next";
23

34
const withMDX = createMDX();
45

6+
const cargoToml = readFileSync("../Cargo.toml", "utf-8");
7+
const version = cargoToml.match(/^version\s*=\s*"(.+)"/m)?.[1] ?? "latest";
8+
59
/** @type {import('next').NextConfig} */
610
const config = {
11+
env: { HADRIAN_VERSION: version },
712
reactStrictMode: true,
813
// Static export for serving from gateway
914
output: "export",

justfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
# Default feature profile (full, standard, minimal, tiny)
2+
profile := "full"
3+
4+
# Install Rust nightly, frontend deps, and model catalog
5+
init:
6+
rustup toolchain install nightly --component rustfmt
7+
cd ui && pnpm install
8+
cd docs && pnpm install
9+
./scripts/fetch-model-catalog.sh
10+
./scripts/fetch-openapi-specs.sh
11+
12+
# Build frontend assets and release binary (use profile=minimal for faster builds)
13+
build: build-frontend build-backend
14+
15+
# Build frontend assets (UI + docs)
16+
build-frontend:
17+
cd ui && pnpm run generate-api && pnpm build && pnpm storybook:build
18+
cd docs && pnpm build
19+
20+
# Build release binary
21+
build-backend:
22+
cargo build --release --no-default-features --features {{profile}}
23+
24+
# Remove build artifacts
25+
clean:
26+
cargo clean
27+
rm -rf ui/dist ui/storybook-static docs/out data/
28+
129
# Run all CI checks (sequential)
230
check: check-rust check-ui check-docs check-openapi check-helm check-security
331

0 commit comments

Comments
 (0)