A basic DevContainer setup and web page to test API responses using Ollama.
For use without a GPU (E.g. GitHub codespaces, and macOS) please:
- Rename
.devcontainer/docker-compose_CPU.yaml
to.devcontainer/docker-compose.yaml
. - In TestAPI.sh change
localhost:11434
toollama11434
The containers currently build and run, but there are CORS errors when trying to interact with Ollama's API.
This repo is setup for use with NVIDIA cards and Docker containers.
- Install the NVIDIA Container Toolkit (CTK) on the host device.
WSL2 Users take note you may need to run an extra command to configure the CTK.
sudo nvidia-ctk runtime configure --runtime=docker --config /mnt/<windows drive>/Users/<your user>/.docker/daemon.json
- Install Docker/Docker Desktop on the host device.
cd ollamaapp
npm install
node index.js
Navigate to localhost:3000
on the host machine. Ollama is running on port 11434
in a separate container.
- Pull the model specified in the
MODEL
variable (index.html). - Enter a prompt into the text box.
- Click Submit and wait for the output to be displayed on the page.
A RTX 2060, Ryzen 5 2600, 24GB DDR4 took ~4 minutes to create a response when first run. Subsequent runs do not take as long.