-
Notifications
You must be signed in to change notification settings - Fork 1
Local LLM setup #5
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
Open
geritwagner
wants to merge
1
commit into
main
Choose a base branch
from
local_llm
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 all commits
Commits
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 hidden or 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
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -20,6 +20,9 @@ | |
| - role: docker | ||
| tags: [docker] | ||
|
|
||
| - role: local_llm | ||
| tags: [local_llm] | ||
|
|
||
| - role: grobid | ||
| tags: [grobid] | ||
|
|
||
|
|
||
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| --- | ||
| local_llm_docker_packages: | ||
| - docker-ce | ||
| - docker-ce-cli | ||
| - containerd.io | ||
| - docker-buildx-plugin | ||
| - docker-compose-plugin | ||
| local_llm_python_packages: | ||
| - python3-docker | ||
|
|
||
| local_llm_data_dir: /opt/local-llm | ||
| local_llm_network_name: local-llm | ||
|
|
||
| local_llm_ollama_image: ollama/ollama:latest | ||
| local_llm_ollama_container_name: ollama | ||
| local_llm_ollama_port: 11434 | ||
| local_llm_ollama_models_dir: "{{ local_llm_data_dir }}/ollama" | ||
|
|
||
| local_llm_webui_image: ghcr.io/open-webui/open-webui:main | ||
| local_llm_webui_container_name: open-webui | ||
| local_llm_webui_port: 3000 | ||
| local_llm_webui_data_dir: "{{ local_llm_data_dir }}/open-webui" | ||
| local_llm_webui_auth: true | ||
| local_llm_webui_default_models: "" | ||
|
|
||
| # Keep empty by default to avoid pulling large models unintentionally. | ||
| # Example: | ||
| # local_llm_models: | ||
| # - llama3.2:3b | ||
| local_llm_models: [] |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| --- | ||
| - name: Install Docker Engine packages | ||
| ansible.builtin.dnf: | ||
| name: "{{ local_llm_docker_packages }}" | ||
| state: present | ||
| update_cache: true | ||
|
|
||
| - name: Install Python Docker SDK dependency for Ansible modules | ||
| ansible.builtin.dnf: | ||
| name: "{{ local_llm_python_packages }}" | ||
| state: present | ||
|
|
||
| - name: Enable and start Docker service | ||
| ansible.builtin.systemd: | ||
| name: docker | ||
| enabled: true | ||
| state: started | ||
|
|
||
| - name: Create local LLM data directories | ||
| ansible.builtin.file: | ||
| path: "{{ item }}" | ||
| state: directory | ||
| owner: root | ||
| group: root | ||
| mode: "0755" | ||
| loop: | ||
| - "{{ local_llm_data_dir }}" | ||
| - "{{ local_llm_ollama_models_dir }}" | ||
| - "{{ local_llm_webui_data_dir }}" | ||
|
|
||
| - name: Ensure dedicated Docker network exists | ||
| community.docker.docker_network: | ||
| name: "{{ local_llm_network_name }}" | ||
| state: present | ||
|
|
||
| - name: Run Ollama container | ||
| community.docker.docker_container: | ||
| name: "{{ local_llm_ollama_container_name }}" | ||
| image: "{{ local_llm_ollama_image }}" | ||
| restart_policy: unless-stopped | ||
| state: started | ||
| recreate: true | ||
| published_ports: | ||
| - "127.0.0.1:{{ local_llm_ollama_port }}:11434" | ||
| volumes: | ||
| - "{{ local_llm_ollama_models_dir }}:/root/.ollama" | ||
| networks: | ||
| - name: "{{ local_llm_network_name }}" | ||
|
|
||
| - name: Wait for Ollama API to be reachable | ||
| ansible.builtin.wait_for: | ||
| host: 127.0.0.1 | ||
| port: "{{ local_llm_ollama_port }}" | ||
| timeout: 120 | ||
|
|
||
| - name: Run Open WebUI container | ||
| community.docker.docker_container: | ||
| name: "{{ local_llm_webui_container_name }}" | ||
| image: "{{ local_llm_webui_image }}" | ||
| restart_policy: unless-stopped | ||
| state: started | ||
| recreate: true | ||
| published_ports: | ||
| - "127.0.0.1:{{ local_llm_webui_port }}:8080" | ||
| volumes: | ||
| - "{{ local_llm_webui_data_dir }}:/app/backend/data" | ||
| env: | ||
| OLLAMA_BASE_URLS: "http://{{ local_llm_ollama_container_name }}:11434" | ||
| WEBUI_AUTH: "{{ local_llm_webui_auth | default('True') | string }}" | ||
| DEFAULT_MODELS: "{{ local_llm_webui_default_models | default('') | string }}" | ||
| networks: | ||
| - name: "{{ local_llm_network_name }}" | ||
|
|
||
| - name: Pull configured Ollama models (optional) | ||
| ansible.builtin.command: "docker exec {{ local_llm_ollama_container_name }} ollama pull {{ item }}" | ||
| loop: "{{ local_llm_models }}" | ||
| changed_when: false | ||
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.
This role installs
docker-ce*packages immediately, but it never adds the Docker CE repository first. In this codebase, that bootstrap step exists only inroles/docker/tasks/main.yml(dnf config-manager addrepo ...), while the updated README now instructs running--tags local_llmstandalone. On a fresh Fedora machine, that standalone path will fail during package resolution before containers are created. Add repo setup (or makelocal_llmdepend on thedockerrole) before this install step.Useful? React with 👍 / 👎.