Skip to main content

Youtube Autonomous FastAPI Docker Llama.cpp Module

The module that is providing the functionality related to the Llama.cpp models hub (having the models and using them) through a FastAPI that is included and isolated in a Docker container.

This module is meant to be exposed as a container inside the internal network, to be connected with its own FastAPI that is exposing the functionality outside.

Endpoints

GET

No endpoints by now.

POST

No endpoints by now.

Instructions

I've followed these steps to make llama.cpp available in my laptop as a container running with cuda, and I've adapted this workflow to this project so its done automatically:

  1. I will use a gemma4 image that is built for CUDA, so I will make sure that I have CUDA properly installed and detected by docker. Execute the following command and it will show your Nvidia GPU if installed and detected: $docker run --rm --gpus all nvidia/cuda:12.9.1-runtime-ubuntu24.04 nvidia-smi. If the output is positive, you can go on and use your GPU. Once you've confirmed that you can or cannot, delete the image that has been downloaded with the command. You don't need it.

  2. Create a models folder in which we will store the models we will use (I will use an external SSD to save space). My folder is D:/llama/models.

  3. Download the GGUF model that we need (check the specifications of your PC and choose the right one), in the cmd inside the models folder you created in the 2nd step: $huggingface-cli download unsloth/gemma-4-E2B-it-GGUF gemma-4-E2B-it-UD-Q4_K_XL.gguf --local-dir ./

  4. Download the llamacpp version that is using CUDA, being in the cmd inside the models: $docker run --rm --gpus all -p 8080:8080 -v "${PWD}:/models" ghcr.io/ggml-org/llama.cpp:server-cuda -m --host 0.0.0.0 -ngl 999

Extra

If you download and execute llamacpp by itself, you'll a web client like with ChatGPT in which you can have a chat with your agent (it should probably be accesible through the http://localhost:8080 url). I'm not using it like this, so I wan't it accessible just by my custom endpoints through my APIs.

Metadata

Release files for yta-fastapi-docker-llamacpp 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yta-fastapi-docker-llamacpp 0.0.4
File Size Uploaded
yta_fastapi_docker_llamacpp-0.0.4.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for yta-fastapi-docker-llamacpp 0.0.4
File Interpreter ABI Platform
yta_fastapi_docker_llamacpp-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 10.3 kB

Release files / yta_fastapi_docker_llamacpp-0.0.4.tar.gz

Download URL yta_fastapi_docker_llamacpp-0.0.4.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4936c9433506dd262668c2bd248a4d6f52d6c6c81c035ee4377f324f44e9d116
BLAKE2b-256 checksum
How to use checksums
021cb09d3c55f57f7a9c28a69a52cedb208da452e4d09359c5e753008f282929
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_fastapi_docker_llamacpp-0.0.4-py3-none-any.whl

Download URL yta_fastapi_docker_llamacpp-0.0.4-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d27f97699650f1bf0131bfa5e91d0ca5f3fbc663a1db275fd90ce597e6b3fdd0
BLAKE2b-256 checksum
How to use checksums
a3c73743a21350dc029a83ba251969232be15096e0eb12a909895210676285e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.0 CPython/3.9.0 Windows/10

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page