DOCS / GETTING STARTED / INSTALLATION

Installation

Prerequisites

Bun1.4.0+
Lattice's package manager and the gateway's runtime (preset: 'bun' in nitro.config.ts). Installed lockfile is frozen (bun.lock).
Node^26.0.0
Declared in engines. Some tooling (TypeScript, drizzle-kit) runs under Node semantics even though Bun executes most scripts.
Postgresany recent version
Both the gateway and the dashboard need a database. They can be the same Postgres server (different databases) or entirely separate servers.

Install Bun if you don't already have it:

bash
Authorization: Bearer lattice_sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Clone and install

bash
type ProviderAdapter = {
  id: ProviderId;
  createChatCompletion(
    request: ChatCompletionRequest,
    ctx: ProviderRequestContext,
  ): Promise<ChatCompletionResponse>;
  streamChatCompletion(
    request: ChatCompletionRequest,
    ctx: ProviderRequestContext,
  ): AsyncGenerator<ChatCompletionChunk, void, void>;
};

type ProviderRequestContext = {
  apiKey?: string;
  providerModel: string;
  signal: AbortSignal;
};

bun install resolves the whole workspace in one pass: apps/gateway, apps/dashboard, apps/docs, and packages/api-contract. Dependency versions for shared libraries (Nuxt, Vue, Drizzle, Nitro, Valibot, @xcvzlabs/env, @types/bun, TypeScript) are pinned once in the root package.json under workspaces.catalog/catalogs, so every workspace package references catalog: or catalog:client/catalog:server instead of a hardcoded version.

bun install also runs the repo's prepare script (husky), which installs the Git hooks used for pre-commit and pre-push checks.

Environment files

Each app that talks to Postgres needs its own .env. Copy the examples and fill them in — the next page walks through exactly which values to generate:

bash
{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "created": 1755878400,
  "model": "gpt-4o",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "..." },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 42,
    "completion_tokens": 118,
    "total_tokens": 160
  }
}
WARNING
Never commit a real .env file. .gitignore in both apps excludes .env* except .env.example.

Workspace layout at a glance

text
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","created":1755878400,"model":"gpt-4o","choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null}]}

data: {"id":"chatcmpl-...","object":"chat.completion.chunk","created":1755878400,"model":"gpt-4o","choices":[{"index":0,"delta":{"content":"Sure"},"finish_reason":null}]}

data: {"id":"chatcmpl-...","object":"chat.completion.chunk","created":1755878400,"model":"gpt-4o","choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":{"prompt_tokens":42,"completion_tokens":118,"total_tokens":160}}

data: [DONE]

See Project Structure for the full breakdown, or continue to Quick Start to get the gateway and dashboard running.

LATTICE — INTERNAL AI INFRASTRUCTURE
GITHUB © 2026