Youtube Autonomous FastAPI Docker API Module
Project description
Youtube Autonomous FastAPI Docker API Module
The module that is handled by a docker container to isolate the environment we need for each purpose, exposed by a FastAPI that allows asking for the specific resources.
This project is using poetry to handle the dependencies and the virtual environment, and docker to manage the specific python version and all the code with the app to be executed.
This is the entry point API for all the functionality our Youtube Autonomous system is providing. This API will delegate in other API-containers to get what is needed. Only this API is exposed, and all the other containers have another one (for internal use only).
Steps to do
Considering that we have a docker-compose.yml that includes the different services, we have to copy the VibeVoice voices to the demo/voices folder to let the internal container detect them to be used. We can have any custom voice we want, that will be autodetected, such as demo/voices/fr-Eva_woman.wav.
Endpoints
Youtube
GET
/youtube/videos/{id_video}/youtube/videos/{id_video}/data/youtube/videos/{id_video}/download-best-quality/youtube/videos/{id_video}/download-lowest-quality/youtube/videos/{id_video}/download-1080
You can replace the {id_video} with this id e_YBmIxeyUg for testing.
POST
No endpoints available
Llama.cpp
GET
No endpoints available
POST
/llamacpp/gemma4prompt- The prompt we want to giveoutput_schema- The schema we want as the output
VibeVoice
GET
/vibevoice/speechtext- The text to narratevoice- The voice we want to use to narrate. Choose one voice indemo/voicesor copy your own.
/vibevoice/audiotext- The text to narratevoice- The voice we want to use to narrate (en-Alice_woman,en-Carter_man,fr-Eva_woman, etc.) Choose one voice indemo/voicesor copy your own.
POST
No endpoints available
Proxy
GET
/proxy/imageurl- The url to download the image from.
POST
No endpoints available
Other Instructions
Generate the image
We need to generate the docker image with all the things we need to be able to run the app inside.
- Use the
$ docker build --no-cache -t {LIBRARY_NAME} .command to generate the Docker image by using thedockerfilefile and ignoring the caché. This will download thepython 3.12.xversion, install the dependencies and copy the code. Use this if any dependency has changed since the last time. If you are just updating the code, you can use the following instead. - Use the
$ docker build -t {LIBRARY_NAME} .command to generate the Docker image by using thedockerfilefile. It will download thepython 3.12.xversion, install the dependencies and copy the code, each of these steps only if needed (the cache will make it be ignore if it didn't change).
Run the container
We need to run the container, so it will be mounted and the app will be runing and ready to use.
- Use the command
$ docker rm -f {LIBRARY_NAME} 2>nulto remove the previous container if existing, so we are able to mount it again from zero. - Use the command
$ docker run -d -p "%port%":8000 --name {LIBRARY_NAME} {LIBRARY_NAME}to run and mount the container and make the app be ready to use.
You can also execute the run_server_docker.bat to do all together using the caché (faster).
The docker will run uvicorn in the port 8000 internally, but our navigator will redirect the 8001 to that one, so we can have different docker containers working at the same time to provide different services using the same base (uvicorn + fastapi).
Other details
- To run the project locally, execute the
run_server.batfile or use$ poetry run uvicorn yta_fastapi_docker_base.app.main:app --reloaddirectly.
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_api-0.0.5.tar.gz.
File metadata
- Download URL: yta_fastapi_docker_api-0.0.5.tar.gz
- Upload date:
- Size: 5.6 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 |
4d58e9b1c57a42da81ffe6b1fc25a6fc699fbdba0a8dfb94a8fa9c737f021c42
|
|
| MD5 |
8fef7ea2991468998397e15ec9ef4452
|
|
| BLAKE2b-256 |
71d3e0b8c345c17c589548571102aa69d0bc6a0177a1dcbe48f95c030dab94ac
|
File details
Details for the file yta_fastapi_docker_api-0.0.5-py3-none-any.whl.
File metadata
- Download URL: yta_fastapi_docker_api-0.0.5-py3-none-any.whl
- Upload date:
- Size: 8.8 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 |
396a1ca869735090995aa573fe4bab9e35360a5dbadf20ddc684bfd925fb8df6
|
|
| MD5 |
a5e0d947c1e45bc6779224ad4ccd7852
|
|
| BLAKE2b-256 |
15fc85f64616b4dfc320d5afe6d059570d10599edb4957068ffc55df7773ba50
|