brand
context
industry
strategy
AaaS
Skip to main content
Academy/Action Pack
🎯 Action PackbeginnerFree

Pi-AI: Unified LLM API

Integrate diverse Large Language Models (LLMs) effortlessly with Pi-AI's unified API. This Action Pack shows you how to install Pi-AI, configure providers with automatic model discovery, and seamlessly switch between models using a consistent API.

llmapi-integrationpythonmulti-llmautomation

3 Steps

  1. 1

    Install Pi-AI: Install the `pi-ai` Python package using pip. This provides the core library for unified LLM interaction.

  2. 2

    Initialize LLMClient with Provider Configurations: Instantiate the `LLMClient`, providing your API keys for the desired LLM providers. Pi-AI automatically discovers available models and their optimal configurations.

  3. 3

    Interact with LLMs and Switch Models: Use the `client.chat.completions.create` method to interact with any configured LLM. Easily switch models and providers by changing the `model` parameter, leveraging the consistent API structure.

Ready to run this action pack?

Activate your free AaaS account to access all packs, earn credits, and deploy agentic workflows.

Get Started Free →