The LangEvals server can be run both locally and on a server. This guide will quickly explain how to set up LangEvals on your machine and make API calls to the evaluators.

Set Up Locally

1

Install Poetry

Poetry is used for managing virtual environments in LangEvals. Follow the official Poetry installation guide for detailed instructions.

2

Run the Server

Once Poetry is installed, you can start the LangEvals server with the following command from the root of the project:

poetry run python langevals/server.py
3

Call the Evaluators

With the server running, you can now make API calls to the evaluators on your machine or server:

curl -X POST "https://http://127.0.0.1:8000/ragas/context_precision/evaluate" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"contexts": ["Context 1", "Context 2"],
"relevant_items": ["Relevant item 1", "Relevant item 2"]
}'
4

Great job! Now you can easily use evaluators on your machine and assess your LLMs in the way you want it. For detailed API documentation please refer to API Reference