Skip to content

Repository files navigation

Meridian

Static multi-page AI workspace with a vanilla Vercel Serverless Function. The OmniRoute key remains server-side and the browser receives an SSE stream from /api/chat.

Run

  1. Import the project into Vercel.
  2. In Settings → Environment Variables, set OMNIROUTE_API_KEY, OMNIROUTE_BASE_URL, NVIDIA_NIM_MODEL=nvidia/llama-3.3-nemotron-super-49b-v1.5, OMNIROUTE_PROVIDER_HINT=nvidia, and optionally MAX_OUTPUT_TOKENS.
  3. Deploy. Vercel serves the HTML files and invokes api/chat.js at /api/chat.

POST /api/chat accepts:

{
  "messages": [{ "role": "user", "content": "Summarize this contract." }],
  "max_output_tokens": 700,
  "temperature": 0.2
}

The function intentionally fixes model and X-Provider-Hint rather than accepting them from browsers. It caps message size and output tokens, requests usage in the final stream event, and propagates streaming bytes without buffering.

The gateway payload is OpenAI-chat compatible:

{
  model: "nvidia/llama-3.3-nemotron-super-49b-v1.5",
  messages,
  stream: true,
  stream_options: { include_usage: true },
  max_tokens: 1024,
  temperature: 0.2
}

OmniRoute receives the server-only headers Authorization: Bearer <token> and X-Provider-Hint: nvidia.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages