Skip to content

UntidyOctopus35/express-ollama-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

express-ollama-server

A Node.js Express server with a local LLM chat endpoint powered by Ollama.

Endpoints

Method Path Description
GET /health Health check
GET /users Returns a list of users
POST /chat Send a prompt to the local LLM

POST /chat

Request

{ "prompt": "Write a function to reverse a string" }

Response

{
  "model": "qwen2.5-coder:7b",
  "response": "..."
}

Setup

Prerequisites: Node.js 18+, Ollama installed and running.

# Install dependencies
npm install

# Pull the model
ollama pull qwen2.5-coder:7b

# Start the server
npm start

Server runs on http://localhost:3000 by default.

Configuration

Env var Default Description
PORT 3000 Server port
OLLAMA_URL http://localhost:11434 Ollama base URL
OLLAMA_MODEL qwen2.5-coder:7b Model to use

Testing

npm test

Tests use Jest + supertest. The Ollama API is mocked so tests run without a live model.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors