This project provides an API for interacting with large language models (LLMs) such as Llama2 and Mistral. It allows users to select a model and send queries to the selected model, maintaining conversation context between the user and the LLM.
- User can select a model (Llama2 or Mistral) when the program starts.
- User can send queries to the selected model and receive answers from the LLM.
- The program maintains conversation context between the user and the LLM, allowing for continuous interaction.
- The project is wrapped in a Docker container for easy deployment and testing.
- Docker
- Clone the repository:
- Navigate to the project directory
- Replace the Hugging Face token:
- Open the
main.pyfile. - Locate the line where the
AutoTokenizeris instantiated:tokenizer = AutoTokenizer.from_pretrained(model_id, token="")
- Replace
""with your actual Hugging Face token.
- Build the Docker image
-
Run the Docker container
-
The API will be accessible at
http://localhost:8000/query. -
Build the Docker image:
-
Send a POST request to the
/queryendpoint with the following JSON payload:
{
"model": "llama2",
"question": "Your question here"
}