Skip to main content

Installation

PandasAI requires Python 3.8+ <=3.11. We recommend using Poetry for dependency management:

Quick setup

In order to use PandasAI, you need a large language model (LLM). You can use any LLM, but for this guide we’ll use OpenAI through the LiteLLM extension. First, install the required extension:
Then, import PandasAI and configure the LLM:

Chat with your data

When you ask a question, PandasAI will use the LLM to generate the answer and output a response. Depending on your question, it can return different kind of responses:
  • string
  • dataframe
  • chart
  • number
Find it more about output data formats here.

Next Steps