Youtube Autonomous Docker Ollama Module
A module based on docker to use Ollama and make AI models available through local endpoints.
Important message
This module will no longer be maintained due to the migration to llamacpp (yta-fastapi-docker-llamacpp), which is working faster.
Proyect created based on this post: https://dev.to/savvasstephnds/run-deepseek-locally-using-docker-2pdm. I've modified it a bit by installing a different model, as I used the deepseek-r1:latest instead of the deepseek-r1:7b (you can check the list here: https://www.ollama.com/library/deepseek-r1).
Instructions
- Install the docker container that includes
ollama. This command will create a localollama-modelsfolder in which the models will be downloaded (~2.6GB).
docker compose up -d ollama
- Check that the container has been succesfully installed and is running locally by accessing to the following url. A
Ollama is runningmessage should appear in the web navigator:
http://localhost:11434/
- Install
Deepseekto be used in theOllamacontainer we've installed before, that will be downloaded (~5.2GB):
docker compose exec ollama ollama pull deepseek-r1:latest
- Request to the
http://localhost:11434/api/generateendpoint (using aPOSTmethod and providing the model and the parameters needed to obtain a response).
payload = {
'model': model.value,
'prompt': prompt,
'stream': False
}
response = requests.post(
url = OLLAMA_GENERATE_URL,
json = payload
)
Other models
*To install any other model, look for it in the list mentioned on top of this readme file and install it with the same command as before. If you want to install the llama3.2-vision:latest, just execute this command below:
docker compose exec ollama ollama pull llama3.2-vision:latest
Final command
Execute this commands once you've cloned the project to set up the docker container and the models:
docker compose up -d ollama
docker compose exec ollama ollama pull deepseek-r1:latest
docker compose exec ollama ollama pull gemma3:latest
To update the image
If you want to update the image because the latest was built a long time ago and you want the most recent, you can use the docker compose pull ollama command that will pull the real latest one.
Metadata
Release files for yta-docker-ollama 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| yta_docker_ollama-0.0.6.tar.gz | 4.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| yta_docker_ollama-0.0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.5 kB
Release files / yta_docker_ollama-0.0.6.tar.gz
| Download URL | yta_docker_ollama-0.0.6.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e6caa8e003b47baf0bcc0ffc1dfe2029b77e274f38f94548d0ea66081bcc99c6
|
|
BLAKE2b-256 checksum How to use checksums |
f8f0ce9304c7d5eaf1c7e42b496b4595e0538ba923e34e8a2f1743478aa8b379
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.0 CPython/3.9.0 Windows/10
|
Release files / yta_docker_ollama-0.0.6-py3-none-any.whl
| Download URL | yta_docker_ollama-0.0.6-py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b823461877b724be7b5d0bd3e46a8d4be7c607c6860ea8e282985add81a67d52
|
|
BLAKE2b-256 checksum How to use checksums |
817bc656b90b381accd5be375f14e28321e272010c32754f54ce9e3e3515961a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.0 CPython/3.9.0 Windows/10
|