# Aristotele — Human Setup TODO Checklist

Keep this guide alongside you when wiring up **Firebase AI Logic**, **Chrome Gemini Nano**, **`aristotele.vaked.dev` DNS**, **LAN nodes**, and **Devpost #BuildHybridAI 2026** submission assets. (Never commit private keys or `.env` files to git!)

---

## 1. Firebase Console & Firebase AI Logic Setup (~5 min)

1. Go to the [Firebase Console](https://console.firebase.google.com/) and create or select your project.
2. Open **AI Logic** (`Build -> AI Logic` or `https://console.firebase.google.com/project/_/ailogic/`).
3. Choose and enable at least one Gemini API provider:
   - **Gemini Developer API (Recommended to start fast — Free Tier available):** click **Enable** under *Gemini Developer API*. Matches Aristotele's `google_ai` (`GoogleAIBackend`) mode.
   - **Agent Platform Gemini API (formerly Vertex AI in Firebase):** click **Enable** if your project is on Blaze and you want enterprise quotas/grounding SLAs. Matches Aristotele's `agent_platform` (`AgentPlatformBackend`) mode.
4. Register a **Web App** in **Project Settings -> Your apps -> Add app (`</>`)**, copy the `firebaseConfig` JSON (`apiKey`, `authDomain`, `projectId`, `appId`), and paste it into:
   - **Studio WebApp -> AI Models -> Firebase AI Logic -> Paste Firebase Config JSON -> Save & Enable**, OR
   - `~/.aristotele/firebase.json` if scripting locally.
5. *(Optional toggles in Studio)*:
   - Check **Ground with Google Search** to attach `{ googleSearch: {} }` citations to cloud Gemini responses.
   - Keep **Enable WebMCP Function Calling** checked when you want Gemini to call `local_hardware_probe`, `maple_20b_a1b_probe`, `memory_palace_search`, and `session_export_markdown` (note: Gemini API separates built-in `googleSearch` from custom `functionDeclarations`, so uncheck Search Grounding when testing WebMCP function calls).

---

## 2. Firebase App Check (Protect Your Gemini Quota)

1. In Firebase Console -> **Build -> App Check**, register a **reCAPTCHA Enterprise** provider for your Web App (or domain `aristotele.vaked.dev` + `127.0.0.1` / `localhost`).
2. Copy the reCAPTCHA Enterprise **Site Key** into Studio's **App Check Site Key** input.
3. Keep **Enable App Check Debug Token for Localhost** checked while developing on `http://127.0.0.1:1337`; inspect DevTools Console for the printed Firebase debug UUID and add it under **App Check -> Apps -> Manage debug tokens** in Firebase Console.

---

## 3. Firebase Hosting Deploy (`firebase-app/`)

If you also want `https://<your-project>.web.app` serving Aristotele Studio + discovery files:

```sh
cd firebase-app
npx firebase-tools login
npx firebase-tools use <YOUR_FIREBASE_PROJECT_ID>
npx firebase-tools deploy --only hosting
```

---

## 4. Custom Domain DNS (`aristotele.vaked.dev`)

`dig` currently shows `aristotele.vaked.dev` resolves to Cloudflare apex proxy IPs with no `CNAME` record yet, so the repo includes `docs/CNAME.aristotele.vaked.dev` without prematurely activating a broken `docs/CNAME`.

Once ready to go live on `https://aristotele.vaked.dev`:

1. In **Cloudflare DNS** for `vaked.dev`, add record:
   - **Type:** `CNAME`
   - **Name:** `aristotele`
   - **Target:** `8b-is.github.io`
   - **Proxy status:** DNS only (grey cloud) initially while GitHub provisions the TLS certificate, then optionally Proxied (`Full (strict)` SSL).
2. Enable GitHub Pages custom domain:
   ```sh
   git mv docs/CNAME.aristotele.vaked.dev docs/CNAME
   git commit -m "chore(pages): enable aristotele.vaked.dev custom domain"
   git push origin main
   ```
3. In **GitHub -> `8b-is/aristotele` -> Settings -> Pages**, confirm `aristotele.vaked.dev` shows HTTPS **Enforced**.

---

## 5. Chrome Built-In Gemini Nano & WebMCP Flags (Desktop Chrome)

For true zero-cloud **On-Device** browser inference (`window.LanguageModel`) and native `navigator.modelContext`:

1. Open `chrome://flags/#optimization-guide-on-device-model` -> set **Enabled BypassPerfRequirement**.
2. Open `chrome://flags/#prompt-api-for-gemini-nano` -> set **Enabled** (or **Enabled Multilingual**).
3. *(Optional WebMCP preview)* Open `chrome://flags` and enable `web-machine-learning` / WebMCP flags if available in your Chrome build.
4. Relaunch Chrome, open `chrome://on-device-internals`, trigger model download if status is `downloadable`, then click **Open Studio** — the top-bar pill switches to **Chrome Gemini Nano: available**.

---

## 6. LAN / Offline / Maple 20B-A1B Local Server Setup

Choose any private inference node (no cloud account required):

- **Air-Gapped Local (Built-in Kolibry / Maple Probe):**
  ```sh
  aristotele --local-only app
  ```
- **Ollama on Localhost or LAN (`http://<LAN_IP>:11434/v1`):**
  ```sh
  OLLAMA_HOST=0.0.0.0:11434 ollama serve
  ollama pull qwen2.5-coder:7b
  aristotele --provider http://127.0.0.1:11434/v1 --model qwen2.5-coder:7b app
  ```
- **Maple 20B-A1B Ternary MoE (`ggml-org/llama.cpp#27000`):**
  ```sh
  llama-server -hf deepgrove/maple-preview --port 8080
  aristotele --provider maple app
  ```
- **Studio UI Wizard:** Go to **AI Models -> LAN / On-Device / Offline Setup Wizard**, pick a preset (`Ollama`, `vLLM`, `Maple`, or `Air-Gapped Local`), or type a custom LAN URL and click **Save & Switch Primary**.

---

## 7. BuildHybridAI 2026 Devpost Submission Checklist

1. Confirm live URLs respond HTTP `200`:
   - `https://8b-is.github.io/aristotele/` (and `https://aristotele.vaked.dev/` after Step 4)
   - `https://aristotele.vaked.dev/studio.html`
   - `https://aristotele.vaked.dev/llms.txt` & `.well-known/mcp.json`
2. Record a 60–90s demo video showing:
   - Top-bar routing switch (`Hybrid Auto` -> `Private Only` -> `Cloud First`) + Multimodal attachment (Image/PDF)
   - Google Search Grounding / WebMCP `local_hardware_probe` + 1-click Skills
   - Maple 20B-A1B benchmark (`POST /v1/maple/bench` or `aristotele bench`)
   - `Cmd+K` Command Palette + Security Posture card.
3. Paste text/links from `docs/DEVPOST_SUBMISSION.md` into Devpost!
