Skip to content

cv01d/bedrock-interface

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bedrock LLM-Interface

A small, simple, local-only chat interface for Amazon Bedrock. Pick any Bedrock model, organize chats under projects (system prompt + project data + rolling memory), and give the model built-in tools for searching your past chats, generating images, and searching the web.

Features

  • Any Bedrock chat model — in-region models and cross-region inference profiles, with running per-chat cost and token tracking.
  • Projects (folders) — group chats under a system prompt + project data, with a rolling memory summary the model carries across chats. The project panel lists every chat in the project (archived ones included) and opens them in one click. You can move a chat into or out of a project at any time; its system-prompt snapshot is re-derived from the new project on the move.
  • Conversation controlsStop a streaming response (the partial reply is kept), Regenerate the latest assistant turn, and Remove from view any turn (hidden from both the transcript and the model's context, but never deleted from history).
  • Favorites — bookmark any turn with the bookmark button. Favorites get their own tab, are renameable, and jump you straight back to the turn in its original chat.
  • Archive — move chats out of the main list into a separate Archived tab to keep the active list uncluttered; unarchive (or delete) them anytime.
  • Attachments — upload images (vision) and documents (pdf/csv/docx/xlsx/txt/md/html/…) by picking a file or drag-and-drop; images render inline in the transcript.
  • Attach a web page by URL — paste a URL in the composer and the server fetches a readable text version of the page (via Mozilla Readability) and attaches it to your next message as reference data. This is a user-initiated fetch, not a model tool — so injected page content can't drive the model to fetch an attacker URL. The fetcher blocks private, loopback, link-local, and cloud-metadata addresses (re-validated across redirects) to prevent SSRF.
  • Image generationgenerate_image tool backed by a Bedrock image model (Amazon Nova Canvas / Titan, or Stability), selectable in Settings. Generated images are saved as attachments and shown in the chat.
  • Web searchweb_search tool backed by Tavily; add an API key in Settings to enable it. Results render as a clickable sources list.
  • Chat history searchsearch_chat_history tool lets the model pull facts from your earlier conversations.
  • Prompt caching on supported models, with estimated cache-token cost accounting.
  • Tunable generation — set temperature and context size (how many recent messages are sent to the model) per your needs in Settings.

Tools (history/image/web search) are only offered to tool-capable models (Anthropic Claude and Amazon Nova). Image generation and web search also require the relevant Settings config to be present.

Stack

  • Server: Node.js + Express + TypeScript, SQLite via the built-in node:sqlite
  • Client: React + Vite + TypeScript
  • AWS: Bedrock Converse API (@aws-sdk/client-bedrock-runtime), credentials stored encrypted in the Settings table and decrypted at request time

Setup

Requires Node 22.5+ (uses the built-in node:sqlite; tested on Node 26).

npm install

# Generate a 32-byte master key and put it in .env
npm run keygen           # prints a base64 key
# set MASTER_KEY=<that value> in .env  (PORT defaults to 3000)

npm run dev              # server on :3000, client on :5173 (proxies /api)

Open http://localhost:5173, go to Settings, and enter your AWS access key, secret, and region. Saving runs a Bedrock smoke test and reports how many models are reachable. Then pick a summarizer model (a small/cheap one like Haiku or Nova Lite).

Optional, in the same Settings page:

  • Image model — pick one of the image-generation models your account can invoke (e.g. Nova Canvas, Titan Image, or a Stability model) to enable the generate_image tool. Leave it off to disable image generation.
  • Tavily API key — paste a key from tavily.com to enable the web_search tool (free tier ≈ 1,000 searches/month). It's encrypted at rest like your AWS credentials.
  • Temperature / context size — tune sampling temperature and how many recent messages are sent to the model on each turn.

Required IAM permissions

The AWS credentials you save need:

bedrock:Converse
bedrock:ConverseStream
bedrock:InvokeModel
bedrock:InvokeModelWithResponseStream
bedrock:ListFoundationModels
bedrock:ListInferenceProfiles

Newer Claude models (Sonnet 4/4.5, Opus 4/4.7, Haiku 3.5) require a cross-region inference profile rather than a bare model id — these are grouped under "Cross-region" in the model picker. You must also have requested model access for the models you intend to use in the Bedrock console.

Some accounts now enforce the dedicated bedrock:Converse / bedrock:ConverseStream actions (this app uses the Converse API). If you scope IAM tightly, include those two alongside the InvokeModel* actions.

Note: Pricing and tokens may vary per chat and/or model. It is ok to use as a guide for estimating, but do not rely on it.

Scripts

  • npm run dev — run server + client together
  • npm run build — typecheck the server and build the client bundle
  • npm run start — run the server (serves the built client if client/dist exists)
  • npm run keygen — print a fresh base64 MASTER_KEY

Screenshots

Screenshot 2026-05-30 at 2 22 28 PM Screenshot 2026-05-30 at 2 21 29 PM Screenshot 2026-05-30 at 2 24 09 PM Screenshot 2026-05-28 at 6 39 10 PM Screenshot 2026-05-28 at 6 39 45 PM

About

LLM interface for use with Amazon Bedrock Models

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages