Installation
Prerequisites
Bun1.4.0+preset: 'bun' in nitro.config.ts). Installed lockfile is frozen (bun.lock). Node^26.0.0engines. Some tooling (TypeScript, drizzle-kit) runs under Node semantics even though Bun executes most scripts. Postgresany recent versionInstall Bun if you don't already have it:
Authorization: Bearer lattice_sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxClone and install
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:
{
"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
}
}.env file. .gitignore in both apps excludes .env* except .env.example. Workspace layout at a glance
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.