generated from vsoch/docsy-jekyll
-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft: Ollama API with Podman Compose #93
Open
jroddev
wants to merge
3
commits into
ublue-os:main
Choose a base branch
from
jroddev:patch-1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,16 +17,18 @@ | |
|
||
Since Alpaca doesn't expose any API, if you need other applications than Alpaca to interact with your ollama instance (for example an IDE) you should consider installing it [in a docker container](https://hub.docker.com/r/ollama/ollama). | ||
|
||
To do so, first configure docker to use the nvidia drivers (that come preinstalled with Bluefin) with: | ||
To do so, first configure docker to use the nvidia drivers (that come preinstalled with Bluefin). | ||
|
||
```bash | ||
# Only required for Docker, Not required for Podman | ||
sudo nvidia-ctk runtime configure --runtime=docker | ||
sudo systemctl restart docker | ||
``` | ||
|
||
Then, choose a folder where to install the ollama container (for example `~/Containers/ollama`) and inside it create a new file named `docker-compose.yaml` with the following content: | ||
|
||
```yaml | ||
# docker compose | ||
--- | ||
services: | ||
ollama: | ||
|
@@ -45,10 +47,38 @@ | |
- gpu | ||
``` | ||
|
||
```yaml | ||
# podman-compose | ||
--- | ||
services: | ||
ollama: | ||
image: ollama/ollama | ||
container_name: ollama | ||
restart: unless-stopped | ||
ports: | ||
- 11434:11434 | ||
volumes: | ||
- ./ollama_v:/root/.ollama:z | ||
devices: | ||
- nvidia.com/gpu=all | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This might work with docker-compose as well. If so we can probably unify the 2 blocks ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does not work for
|
||
deploy: | ||
resources: | ||
reservations: | ||
devices: | ||
- capabilities: | ||
- gpu | ||
|
||
``` | ||
|
||
|
||
Finally, open a terminal in the folder containing the file just created and start the container with | ||
|
||
```bash | ||
docker compose up -d | ||
# or | ||
sudo podman-compose up -d | ||
# podman needs to be run as root for nvidia gpu passthrough until this is fixed | ||
# https://github.com/containers/podman/issues/19338 | ||
``` | ||
|
||
and your ollama instance should be up and running at `http://127.0.0.1:11434`! | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Permission denied in podman without
:z