Skip to Content
ProTemplates

Murmur, Pro

A console for a model API or LLM gateway, for Next.js. Install it into a new project, then rewrite its sample API to read your gateway's requests, keys and billing.

Murmur is a whole app made of Dashboardblocks blocks: the console an AI API company or LLM gateway gives the developers who call it. Overview shows spend, requests and credit; Requests lists every call and why it failed; Models and Providers show what serves them; Routing, Guardrails, Budgets and Keys control each call; Customers puts each customer's AI cost beside what they pay; and Billing and Settings run the workspace. Every page reads and writes through one sample API, so the app works as soon as it's installed. Open the preview to try it first.

Install

Murmur comes with All-Access and installs with the shadcn CLI.

  1. Make a Next.js project with shadcn set up, at shadcn create (opens in a new tab) or with the CLI:

    npx shadcn@latest init --template next
  2. Add the @dashboardblocks-pro registry and your token, as Installation shows.

  3. Install Murmur:

    npx shadcn@latest add @dashboardblocks-pro/murmur-next --overwrite
  4. Run npm run dev and open /overview.

With --overwrite, the CLI replaces any file you have that Murmur also ships, such as shadcn components and blocks you've changed and a proxy.ts, so commit first and check the diff. Without it, the CLI asks about each of those files, and skips them all when it can't ask. Your root layout, home page and theme stay as they are, and Murmur takes your shadcn style, component library and icon set.

What it adds

PathWhat's there
app/(murmur)/The routes. Each one loads its page's data from the sample API and passes it to the page.
components/murmur/pages/A component per page. They take data and callbacks as props and know nothing about Next.js.
lib/murmur/api/The sample API: async functions in index.ts and the files beside it, their types in types.ts, and Larkfield's requests, models, keys, customers and credit in data/.
components/murmur/next/The layout, the session, the proxy, and the Server Actions each page calls.
components/murmur/routes.tsThe list of pages that the rail and search read, and which roles may open each.
components/murmur/The parts every page shares: the app shell, the logo, the link adapter, and the links and headings several pages share.
proxy.tsRuns Murmur's proxy on its pages.

In a project with a src/ folder, they go in src/. The blocks Murmur uses install next to your other blocks in components/dashboardblocks/.

Use your own data

Pages never load data themselves. Each route file calls functions from lib/murmur/api, and each change goes through a Server Action that calls one too. To show your gateway's traffic, rewrite the bodies of those functions and keep their types. The pages, routes and actions stay as they are.

  1. Start with the page you need first. Its route file in app/(murmur)/ names the functions it calls, such as getOverview for Overview.
  2. Rewrite each function to read your request logs, keys and billing, and return the type types.ts gives it. A write returns a result the page shows, such as a refusal with its reason, so keep returning one.
  3. Once nothing reads data/ any more, delete it.

The sample's numbers agree across pages: Overview's spend is the sum of the requests, a key's spend is its requests, and Billing's usage is Overview's spend. Read each from the same request log in your app and they keep agreeing.

Every read and write takes the session first and checks the signed-in member's role in lib/murmur/api: a read for a page their role can't open returns null, and a write they can't make is refused. Members see Overview, Requests, Models, Providers and Keys, and change only the keys they made. Admins also manage Routing, Guardrails, Budgets, Customers, providers, members and webhooks. Only the owner opens Billing, changes single sign-on and the data policy, hands the workspace over and deletes it. Keep those checks when you move a read or a write to your database.

Keep what people change

The sample API keeps its changes in the server's memory, in one copy every visitor shares, until the server restarts. That includes handing the workspace over and leaving it, so restart the server to be the owner again. Your database replaces it: once a write stores its change, the next read shows it, on every server. The project each person last opened and the notifications they've read are in cookies (components/murmur/next/session.ts); keep them on their account in your app.

Billing and webhooks

The writes that would reach your payment provider say where in their doc comments. buyCredit charges the saved card, retryTopUp charges it again for a declined auto top-up, and updateCard saves a new one. The card form on Billing is a stand-in: put your payment provider's own card element there, so a card number never reaches your server.

Webhook test sends and deliveries are recorded in the sample and never leave the server. Post them to each endpoint's URL, signed with its secret, where sendWebhookTest, retryWebhookFailures and replayWebhookDelivery record one (record in webhooks.ts).

Add your auth

components/murmur/next/session.ts tells every page who is signed in. For now Sofia Rossi, Larkfield's owner, is signed in until she signs out. Change getSession to read your auth library's session and return null when no one is signed in, and set memberId to the signed-in member's id. It already returns null for someone who isn't in the workspace (isInWorkspace), and the sample API reads each member's role from their record. Once your members come from your database, make isInWorkspace and the role read it too. Until you change getSession, everyone who signs in is Sofia.

The /sign-in and /sign-out routes in proxy.ts stand in for your auth library's own. Once you add yours, take them out of its matcher and out of components/murmur/next/proxy.ts, and point the sign-in and sign-out links at your library's pages: they're in components/murmur/next/next-shell.tsx, components/murmur/pages/settings-members-page.tsx and components/murmur/pages/settings-general-page.tsx.

If you had a proxy.ts before, put yours back and call murmurProxy(request) from components/murmur/next/proxy.ts for the paths in the matcher of the one Murmur installed.

Logos

The model makers' and providers' logos belong to them. Murmur shows them to name the models and providers a request went to, as gateways do. Check each one's brand guidelines before you change how they're shown.

On this page