A self-hosted AI chat interface with support for multiple providers (LM Studio, Ollama) and MCP (Model Context Protocol).
- Node.js (v24 recommended)
- PostgreSQL (v18 recommended)
npm run setupCreate server/.env. The following is an example — adjust the values for your environment:
NODE_ENV=production
DATABASE_URL=postgresql://user:password@localhost:5432/tenjo
DATABASE_SCHEMA=tenjo
SESSION_SECRET=your-secret-key-here
LISTEN_HOST=127.0.0.1
LISTEN_PORT=3000
ENCRYPTION_KEY=your-encryption-key-here
BASE_URL=https://chat.example.com
| Variable | Description |
|---|---|
DATABASE_URL |
PostgreSQL connection string |
DATABASE_SCHEMA |
PostgreSQL schema name |
SESSION_SECRET |
Secret used for session encryption |
LISTEN_HOST |
Host address to bind to |
LISTEN_PORT |
Port number to listen on |
DATA_DIR |
Data directory path (default: files/ under the server working directory) |
SINGLE_USER_MODE |
Set to true to run in single-user mode |
ENCRYPTION_KEY |
Encryption key for credentials (API keys, OAuth tokens, etc.) stored in the database |
BASE_URL |
Public base URL of the application (e.g. https://chat.example.com) |
npm run build
npm startnpm run devNote: The environment variable
LISTEN_PORTmust be3000during development. The Vite dev server proxies API requests tolocalhost:3000, so changing the port will break the proxy.
How do I add new users? The first user to register automatically becomes an admin. After that, registration requires an invitation code. Admins can generate and manage invitation codes from the settings page. Codes are single-use and determine the new user's role (admin or standard).
Images in prompts are not working. The connected model must support vision. Use a vision-capable model if you want to include images in prompts.
MCP tools are not working. The connected model must support function calling. MCP tool calling will not work with models that do not support it. Even with supported models, tool calls may not work well depending on the model's capability.
What is the email address at registration used for? It is only used as an alternative to the username when logging in.
MIT © netalkGB