Generate random "inspirational" quotes images by using an AI text generation model.
The following models can be used:
- meta-llama/Llama-3.1-70B through GroqCloud API
- google/gemma-2-9b-it through GroqCloud API
- mistralai/Mixtral-8x7B-Instruct-v0.1 through GroqCloud API
- A background is picked from Unsplash, either randomly or by giving roboquote a search query.
- The model is prompted to give an "inspirational" quote for the given background search query.
- The quote is inserted on the image which is then saved.
- Install the project with poetry by doing
poetry install
. - Set environment variables for configuration (the project uses environs so you can also put the variable in a env file):
GROQ_CLOUD_API_KEY
(required): your GroqCloud API key for their APILOG_LEVEL
(optional, default isWARNING
): log level of the applicationWEB_DEBUG
(optional, default isFalse
): if you want to run the web app in debug mode (should not be required)
Run poetry run python main.py my_file.jpg
to generate a new random image.
See poetry run python main.py --help
for the available options.
The web version is a Starlette application (roboquote.web.app:app
).
It can be launched quickly locally with uvicorn through the make run-web
command.
- atomicparade for the code used to do the text auto wrapping
- Google Fonts for the fonts used in the pictures
- Google for the gemma-2-9b-it model used
- Groq for their inference API
- Meta for the Llama-3.1-70B model used
- Mistral AI for the Mistral-7B-Instruct-v0.1 model used
- Unsplash for the background images