> ## Content Index
> Fetch the complete content index at: https://www.stirup.si/llms.txt
> Use this file to discover other available public pages before exploring further.

# Setup and Configuration of LLM Application with Node.js and Ollama
- URL: https://www.stirup.si/setup-and-configuration-of-llm-application-with-node-js-and-ollama-83c6dad8/
- Published: 2026-10-15T04:30:29.000Z
- Updated: 2026-10-15T04:30:29.000Z
- Description: The application requires Node.js 22+ and uses npm to install dependencies, with local embedding computation via Ollama and configurable model settings.
- Author: Satish Das
- Tags: Community, Guide, Stirup Research

## Setup and Installation

To set up and install the application, start by ensuring Node.js 22+ is installed. Clone the repository using `git clone https://github.com/canaanmckenzie/sidelong.git`, then navigate into the project directory with `cd sidelong`. Run `npm install` to install the development dependencies, which are limited to TypeScript and `@types/node`. The `.npmrc` file disables install scripts and pins exact versions for consistency. To start the application, execute `npm start`, which runs preflights, checks for the Claude CLI, starts Ollama if needed, pulls the embedding model (\~670 MB), and launches the servers. The application is accessible at `http://localhost:5173`. Alternatively, you can run components manually: `ollama serve` for embeddings, `npm run server` for the thin server, and `npm run dev` for the app, starting any of the three processes in any order.

## Model and Embedding Configuration

In configuring models and embeddings for LLM applications, the default embedding model is **mxbai-embed-large**, as noted in testing where smaller models failed to distinguish between 'same thread' and 'same broad domain' contexts (e.g., a question about sardines outperformed a genuine networking follow-up on nomic-embed-text). Embeddings are computed locally by **Ollama** and remain on the user's machine, ensuring privacy and control over data. Configuration options include variables such as **PORT** (default: 8787), **SIDELONG\_ORIGIN** (default: http://localhost:5173), **CLAUDE\_BIN** (default: claude), **OLLAMA\_URL** (default: http://127.0.0.1:11434), and **EMBED\_MODEL** (default: mxbai-embed-large). If the embedding model is changed, users must re-fit the **EMB** variable in **src/jev.js** using **tools/calibrate.js**. The application is built with plain JavaScript, native ES modules, and requires no framework, build step, or runtime dependencies.

## System Architecture and Components

The system architecture is designed with simplicity and modularity in mind. The thin server, implemented in `server/index.js` (approximately 200 lines), operates on localhost and does not store any credentials. Its primary responsibilities are to spawn the `claude -p` process and to interface with Ollama. This design ensures minimal overhead and clear separation of concerns. Type definitions are managed through JSDoc comments, which are validated using `tsc --noEmit` as part of the `npm run check` command. Testing is handled by Node’s built-in test runner via `npm test`. The system requires a Claude subscription, as noted in the design documentation, which is a deliberate choice rather than an unintended limitation. This approach emphasizes the use of external services while maintaining a lightweight and focused server implementation.

## User Interface and Color Coding

User interface design in LLM-based applications often incorporates color coding to enhance readability and user experience. According to [Hacker News Show](https://github.com/canaanmckenzie/sidelong?ref=stirup.si), every page is marked with a 12px square on the open page and a 3px spine on collapsed strips, providing visual cues for navigation. [Hacker News Show](https://github.com/canaanmckenzie/sidelong?ref=stirup.si) explains that a hue circle represents one dimension, while topics are not inherently tied to this scale. This means that with enough distinct topics, two unrelated threads may end up at nearby angles on the hue circle, which can lead to potential confusion if not carefully managed. [Hacker News Show](https://github.com/canaanmckenzie/sidelong?ref=stirup.si) highlights that the markdown renderer supports a variety of elements, including paragraphs, fenced code, headings, lists, blockquotes, and inline formatting such as bold, italic, code, and links. These features ensure that content remains structured and visually distinct, aiding users in parsing information effectively.

## Performance and Calibration

In performance and calibration, LLMs rely on precise scoring mechanisms to ensure accurate results. According to [Hacker News Show](https://github.com/canaanmckenzie/sidelong?ref=stirup.si), the system waits approximately 30 ms before scoring a question's embedding against each page's question+answer embedding, which may influence the placement of results. If the post-answer re-score alters the initial verdict, the system retains the history, as noted in [Hacker News Show](https://github.com/canaanmckenzie/sidelong?ref=stirup.si), with a follow-up rate of 84%. Calibration constants are not guessed but are instead derived from measurement, as stated in [Hacker News Show](https://github.com/canaanmckenzie/sidelong?ref=stirup.si). The process involves running `node tools/calibrate.js <model>`, which generates a question-to-page cosine matrix over a fixture deck. These steps ensure that the model's outputs are both timely and well-calibrated, though the effectiveness of these methods depends on the quality of the data used for calibration.

## Sources and reporting notes

- [Hacker News Show](https://github.com/canaanmckenzie/sidelong?ref=stirup.si)

Based on published source material. No independent hands-on testing is claimed.