Phospho: Text Analytics Platform for LLM Apps. Phospho is the text analytics platform for LLM apps. Detect issues and extract insights from text messages of your users or your app. Gather user feedback and measure success. Iterate on your app to create the best conversational experience for your users.
Ship your LLM app in production with confidence, and iterate on it with insights from your users.
The phospho lab is the core analytics component of phospho. The phospho lab helps you run batched evaluations and event detections on your messages.
pip install "phospho[lab]"
Follow the quickstart here.
This repository contains the implementation of the platform frontend, the API backend, and the insights extraction pipeline.
phospho-python
: Python client with analytics engineextractor
: FastAPI analytics service wrapping the analytics enginebackend
: FastAPI backendplatform
: NextJS frontendinternal-tools
: Platform management toolsEnsure you have the following installed:
git clone git@github.com:phospho-app/phospho.git && cd phospho
.env.example
file as a .env.docker
filescp .env.example .env.docker
.env.docker
file with secret variablesnano .env.docker # or emacs or vscode or vim
By default, phospho analytics pipeline use OpenAI as their main LLM provider.
To use Ollama, set OVERRIDE_WITH_OLLAMA_MODEL=mistral
(or any model) in .env.docker
. In this case, theOPENAI_API_KEY
variable is not used. You do need to have an Ollama instance set up and running.
docker-compose up
Go the platform at http://localhost:3000
to grab your project id and api key. Log your first message :
export PHOSPHO_PROJECT_ID="your_project_id"
export PHOSPHO_API_KEY="your_api_key"
curl -X POST "http://localhost:80/v2/log/$PHOSPHO_PROJECT_ID" -H "Authorization: Bearer $PHOSPHO_API_KEY" -H "Content-Type: application/json" -d '{"batched_log_events": [{"input": "Hi, I just logged my first task to phospho!","output": "Congrats! Keep pushing!"}]}'
Don't forget to specify your backend url when you use the client libraries in your app. By default it's http://localhost:80
To manage the phospho lab evaluations on a collaborative platform, the easiest way is to register to the hosted version.
pip install phospho
or npm i phospho
PHOSPHO_API_KEY
and PHOSPHO_PROJECT_ID
phospho.init()
phospho.log(input="question", output="answer")
Follow this guide to get started.
Learn more in the full documentation.
Author: phospho-app
Source Code: https://github.com/phospho-app/phospho
License: Apache-2.0 license