
Open Source · LLM Platform
Synapse — Open-Source LLM Platform
Synapse is a full-stack workspace for evaluating open-source language models without downloading weights or maintaining local inference infrastructure. Users can search the Hugging Face catalogue, open a model workspace, stream a response, and compare two models against the same prompt in real time.
A Go service owns the sensitive and stateful parts of the product: authenticated inference, encrypted credential retrieval, conversation ownership, bounded context, persistence, and incremental delivery. The Next.js interface remains focused on discovery, comparison, conversation management, and model control.
Key Features
Side-by-side model comparison
Dispatches the same prompt to two selected models concurrently and streams each response into an independent comparison panel.
Open-source model discovery
Searches the Hugging Face catalogue and surfaces model ownership, downloads, parameter count, pipeline type, and sortable discovery signals.
Encrypted bring-your-own-key access
Stores multiple named Hugging Face credentials with AES-256-GCM encryption, exposes only token names to the browser, and decrypts the selected credential at inference time.
Persistent conversation workspace
Maintains user-scoped history with generated titles, Markdown and code rendering, conversation rename and deletion, and bounded context across sessions.
Implementation
Go streaming gateway
A Gin API validates the session, resolves the user's encrypted token, builds the Hugging Face request, and flushes response deltas to the browser as they arrive.
Next.js model workspace
Dynamic model routes combine concurrent chat panels, model search, persistent conversation controls, Markdown output, and five inference parameters in one interface.
Conversation memory and storage
PostgreSQL owns user and conversation state, while recent-message windows bound inference context and zlib-compressed transcripts reduce the stored history footprint.
Identity and credential boundary
HTTP-only JWT sessions protect the API, ownership checks isolate conversation records, and raw provider credentials remain behind the Go service boundary.
Architecture in motion
How it works
Model discovery
The browser sends a focused catalogue query through a Next.js route, which retrieves Hugging Face model metadata and returns a sortable result set for direct entry into a model workspace.
- Model search
- Next.js catalogue route
- Hugging Face models API
- Ranked metadata
- Model workspace
Sorts by trending, downloads, likes or recent updates · displays parameter count, downloads and pipeline type
Open full size ↗Concurrent inference
One prompt becomes two independent authenticated inference requests. The Go gateway retrieves the selected credential, opens both upstream streams, and forwards response chunks without coupling one model's completion to the other.
- Authenticated prompt
- Go streaming gateway
- Encrypted token lookup
- Hugging Face router
- Independent response streams
Two selected models receive the same prompt concurrently · each response renders incrementally as its stream advances
Open full size ↗Conversation persistence
Every conversation is scoped to its owner before history is loaded or changed. A bounded context snapshot is sent to the model while the complete compressed transcript remains available for later sessions.
- User-scoped conversation
- 20-message context window
- Zlib-compressed transcript
- PostgreSQL persistence
- Generated title
20-message server memory window · compressed transcript storage · ownership checks on every conversation read and mutation
Open full size ↗Design Choices
Keep credentials behind the service boundary
The client selects a token by name rather than handling its stored value. Decryption happens only inside the authenticated inference path immediately before the upstream request.
Let model streams progress independently
Comparison requests run concurrently and render into separate state, preventing a slower model from blocking the first useful response.
Bound memory instead of growing every request
Recent context keeps conversations coherent while avoiding an unbounded transcript on each inference call; the complete history remains persisted separately.
Separate product UI from inference control
Next.js owns discovery and interaction while Go owns authentication, provider access, streaming, and persistence, keeping sensitive operations out of the browser tier.