[GH-ISSUE #6815] Idea: Model Pre-Pulling on Startup #50815

Closed
opened 2026-04-28 17:11:23 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @adrianliechti on GitHub (Sep 15, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/6815

To ease Docker/Kubernetes based deployments, I would suggest a feature to auto download/update models on startup if not yet existing. See here a poor man implementation of that idea: https://github.com/adrianliechti/ollama/blob/main/main.go.
I could imagine this would also help in samples/documentations.

If you think that this is a good idea but no resources; I could try a proposal.
Probably the biggest challenge is naming the env variable :)

Cheers, Adrian

Originally created by @adrianliechti on GitHub (Sep 15, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/6815 To ease Docker/Kubernetes based deployments, I would suggest a feature to auto download/update models on startup if not yet existing. See here a poor man implementation of that idea: https://github.com/adrianliechti/ollama/blob/main/main.go. I could imagine this would also help in samples/documentations. If you think that this is a good idea but no resources; I could try a proposal. Probably the biggest challenge is naming the env variable :) Cheers, Adrian
GiteaMirror added the feature request label 2026-04-28 17:11:23 -05:00
Author
Owner

@rick-github commented on GitHub (Sep 16, 2024):

You can do this with a compose file:

x-ollama: &ollama
  image: ollama/ollama
  volumes:
    - ./ollama:/root/.ollama

services:
  ollama-init:
    << : *ollama
    restart: no
    entrypoint: bash -c "ollama serve & sleep 10 ; ollama pull ${MODEL-qwen2:0.5b}"

  ollama:
    << : *ollama
    depends_on:
      ollama-init:
        condition: service_completed_successfully

<!-- gh-comment-id:2351861147 --> @rick-github commented on GitHub (Sep 16, 2024): You can do this with a compose file: ```yaml x-ollama: &ollama image: ollama/ollama volumes: - ./ollama:/root/.ollama services: ollama-init: << : *ollama restart: no entrypoint: bash -c "ollama serve & sleep 10 ; ollama pull ${MODEL-qwen2:0.5b}" ollama: << : *ollama depends_on: ollama-init: condition: service_completed_successfully ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#50815