This Python program interacts with a locally running LLAMA3 API, processes the streamed JSON response, and converts the output text to speech using the TTS library.
- Sends a prompt to the LLAMA3 API.
- Parses the streamed JSON response from the API.
- Converts the text response to audio and saves it as
output.wav.
It is recommended to use Anaconda to manage the Python environment and dependencies.
Download and install the LLAMA3 API from the official website
The llama3 server should automatically start after installation. You can test if llama3 is running by opening a terminal and running:
ollama run llama3You should see a prompt that says "Send a message", you can send a prompt and see the response from the LLM.
Download and install Anaconda from the official website.
Create a new Conda environment with Python:
cd path/to/realejo
conda create --prefix ./env
conda activate ./envInstall pip in the local environment:
conda install pipInstall the required Python packages:
pip install -r requirements.txtRun the Python program:
python main.py
# or
python3 main.pyThe program will prompt you to enter a message. After you enter a message, the program will send the message to the LLAMA3 API, parse the response, and save the audio output as output.wav.
This project is licensed under the MIT License - see the LICENSE file for details.