phospho


Namephospho JSON
Version 0.3.20 PyPI version JSON
download
home_pagehttps://github.com/phospho-app/phospho
SummaryText Analytics for LLM apps
upload_time2024-04-30 14:29:19
maintainerNone
docs_urlNone
authorPierre-Louis Biojout
requires_python<4.0,>=3.8
licenseNone
keywords llm agents gen ai phospho analytics nlp
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # phospho Python Client

Phospho is an open source platform to help you monitor LLM apps.

With phospho, monitor every user interaction with your LLM app to identify issues and improve performance. Understand how users use your app and which versions of your product are the most successful.

Read the docs at [docs.phospho.ai](https://docs.phospho.ai/).

> _Warning_ : This project is still under active development!

## Installation of the phospho client

You need Python `>=3.8`

```bash
pip install --upgrade phospho
```

## Quickstart

Create an account on [phospho](https://platform.phospho.ai/). Create an API key and note down the project id. Set them as environment variables:

```bash
export PHOSPHO_API_KEY="your-api-key"
export PHOSPHO_PROJECT_ID="project-id"
```

In the code of your LLM app, log interactions with your agent using `phospho.log()`.

```python
import phospho

phospho.init()

# This is how you log interactions to phospho as strings
phospho.log(input="The user input", output="Your LLM app output")

```

You can also directly pass OpenAI API query and responses (or any object with same format) to phospho :

```python
import phospho
import openai

phospho.init()
openai_client = openai.OpenAI()

# This is your agent code
query = {
    "messages": [{"role": "user", "content": "The user input"}],
    "model": "gpt-3.5-turbo",
}
response = openai_client.chat.completions.create(**query)

# Log the interactions to phospho
phospho.log(input=query, output=response)
```

Monitor and visualize your agent on the [phospho dashboard](https://platform.phospho.ai/).

## phospho lab

You can also use phospho locally to run evaluations and event detection on your text messages.
See the [phospho lab documentation](https://docs.phospho.ai/local/phospho-lab) for more information or the notebook `quicksart.ipynb` in the `notebooks` folder.

## Usage

Read the docs at [docs.phospho.ai](https://docs.phospho.ai/) for more information.
Use your phospho dashboard to monitor your agent, score interactions and detect events.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/phospho-app/phospho",
    "name": "phospho",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": "LLM, Agents, gen ai, phospho, analytics, nlp",
    "author": "Pierre-Louis Biojout",
    "author_email": "contact@phospho.app",
    "download_url": "https://files.pythonhosted.org/packages/69/fc/0ca8b86494336eb8386bcbd23f1e18b4ad2343d6a4fdea1fae4e51a3e99b/phospho-0.3.20.tar.gz",
    "platform": null,
    "description": "# phospho Python Client\n\nPhospho is an open source platform to help you monitor LLM apps.\n\nWith phospho, monitor every user interaction with your LLM app to identify issues and improve performance. Understand how users use your app and which versions of your product are the most successful.\n\nRead the docs at [docs.phospho.ai](https://docs.phospho.ai/).\n\n> _Warning_ : This project is still under active development!\n\n## Installation of the phospho client\n\nYou need Python `>=3.8`\n\n```bash\npip install --upgrade phospho\n```\n\n## Quickstart\n\nCreate an account on [phospho](https://platform.phospho.ai/). Create an API key and note down the project id. Set them as environment variables:\n\n```bash\nexport PHOSPHO_API_KEY=\"your-api-key\"\nexport PHOSPHO_PROJECT_ID=\"project-id\"\n```\n\nIn the code of your LLM app, log interactions with your agent using `phospho.log()`.\n\n```python\nimport phospho\n\nphospho.init()\n\n#\u00a0This is how you log interactions to phospho as strings\nphospho.log(input=\"The user input\", output=\"Your LLM app output\")\n\n```\n\nYou can also directly pass OpenAI API query and responses (or any object with same format) to phospho :\n\n```python\nimport phospho\nimport openai\n\nphospho.init()\nopenai_client = openai.OpenAI()\n\n#\u00a0This is your agent code\nquery = {\n    \"messages\": [{\"role\": \"user\", \"content\": \"The user input\"}],\n    \"model\": \"gpt-3.5-turbo\",\n}\nresponse = openai_client.chat.completions.create(**query)\n\n#\u00a0Log the interactions to phospho\nphospho.log(input=query, output=response)\n```\n\nMonitor and visualize your agent on the [phospho dashboard](https://platform.phospho.ai/).\n\n## phospho lab\n\nYou can also use phospho locally to run evaluations and event detection on your text messages.\nSee the [phospho lab documentation](https://docs.phospho.ai/local/phospho-lab) for more information or the notebook `quicksart.ipynb` in the `notebooks` folder.\n\n## Usage\n\nRead the docs at [docs.phospho.ai](https://docs.phospho.ai/) for more information.\nUse your phospho dashboard to monitor your agent, score interactions and detect events.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Text Analytics for LLM apps",
    "version": "0.3.20",
    "project_urls": {
        "Documentation": "https://docs.phospho.ai",
        "Homepage": "https://github.com/phospho-app/phospho"
    },
    "split_keywords": [
        "llm",
        " agents",
        " gen ai",
        " phospho",
        " analytics",
        " nlp"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e58dd3964d753952ff37bbccfac71d86aeb7399d17c64c4393796eab4c81daf3",
                "md5": "9dc940330b170c99868b08b78438c4bd",
                "sha256": "2697628a878e6b29b3ab20ebbc010063fdff4184f2c56821c1ad6e2b95e66f71"
            },
            "downloads": -1,
            "filename": "phospho-0.3.20-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9dc940330b170c99868b08b78438c4bd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 53855,
            "upload_time": "2024-04-30T14:29:17",
            "upload_time_iso_8601": "2024-04-30T14:29:17.189864Z",
            "url": "https://files.pythonhosted.org/packages/e5/8d/d3964d753952ff37bbccfac71d86aeb7399d17c64c4393796eab4c81daf3/phospho-0.3.20-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "69fc0ca8b86494336eb8386bcbd23f1e18b4ad2343d6a4fdea1fae4e51a3e99b",
                "md5": "348602e55e30a77b19f379e6241a203c",
                "sha256": "7119c2061053ec701eb7663f48a49b794da28f95d1bc6c27e19c14662c13957f"
            },
            "downloads": -1,
            "filename": "phospho-0.3.20.tar.gz",
            "has_sig": false,
            "md5_digest": "348602e55e30a77b19f379e6241a203c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 46916,
            "upload_time": "2024-04-30T14:29:19",
            "upload_time_iso_8601": "2024-04-30T14:29:19.403754Z",
            "url": "https://files.pythonhosted.org/packages/69/fc/0ca8b86494336eb8386bcbd23f1e18b4ad2343d6a4fdea1fae4e51a3e99b/phospho-0.3.20.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-30 14:29:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "phospho-app",
    "github_project": "phospho",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "phospho"
}
        
Elapsed time: 0.28935s