Youtube Autonomous FastAPI Docker Llama.cpp Module
Project description
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:
-
I will use a
gemma4image 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. -
Create a
modelsfolder in which we will store the models we will use (I will use an external SSD to save space). My folder isD:/llama/models. -
Download the GGUF model that we need (check the specifications of your PC and choose the right one), in the cmd inside the
modelsfolder 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 ./ -
Download the
llamacppversion that is using CUDA, being in the cmd inside themodels:$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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yta_fastapi_docker_llamacpp-0.0.3.tar.gz.
File metadata
- Download URL: yta_fastapi_docker_llamacpp-0.0.3.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.0 CPython/3.9.0 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff6b68c41c07574de89c5d30129facef5cbac349ccb521e8f0b9b1d83c25e331
|
|
| MD5 |
a93ef7042f9840636aa19bbc00fb6be9
|
|
| BLAKE2b-256 |
643a882289887bdac6756ad3b1697960a38ab450d945ca8b3a10966c4ca96d5d
|
File details
Details for the file yta_fastapi_docker_llamacpp-0.0.3-py3-none-any.whl.
File metadata
- Download URL: yta_fastapi_docker_llamacpp-0.0.3-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.0 CPython/3.9.0 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f58abae10cde42e5d9f53a83ad3ab979125ade9bd884a2306e1bee068b4afb8
|
|
| MD5 |
538b7fbc3999f399893ab99b7032c82f
|
|
| BLAKE2b-256 |
534d4b7b32b64e647468b02f639f4638eae3029f56d932e87625d81c620620f2
|