This is a server that allows you to leverage the message api of ollama with any of the models available. You can link this up to a frontend. For the purposes of authentication, we are using Supabase.
- Node.js (v18 or higher recommended)
- npm (comes with Node.js)
- Ollama
- Supabase
The frontend is a Next.js app, which can be found here. You supabase credetials for the frontend will be used to authenticate the server.
-
Gain access to common library:
- Ask administrator for access to
letschat-typeslibrary - add ssh key from
letschat-typesto your ssh-agent
# Start SSH agent if needed eval "$(ssh-agent -s)" # Add your GitHub SSH key ssh-add ~/.ssh/id_rsa # or whatever key you use for GitHub
- Ask administrator for access to
-
Install dependencies:
npm install
-
Configure environment variables:
cp .env.example .env
Edit
.envand set your configuration:NODE_ENV- Set toproductionfor production deployment (default:development)DEFAULT_MODEL- The default model to use (not required)PORT- Server port (default:3000)OLLAMA_HOST- Only needed for Docker deployment. URL for Ollama host (default:http://localhost:11434)FRONTEND_DOMAIN- Only needed for Docker deployment. Frontend domain (default:http://localhost:3000)SUPABASE_URL- Supabase URL for authentication (default:undefined)SUPABASE_PUBLISHABLE_KEY- Supabase publishable key for authentication (default:undefined)
Run the server in development mode with hot reload:
npm run devBuild the Docker image:
docker build --ssh default=$SSH_AUTH_SOCK --secret id=dotenv,src=.env -t letschat-server .Run the container:
docker run -p 3000:3000 letschat-serverThe server will start on http://localhost:5050.