PureRouter Installation

PureRouter is a completely independent product from PureCPP. You can use PureRouter without needing PureCPP and vice versa.

Requirements

Before installing PureRouter, make sure you have:
  • Python 3.8 or higher
  • pip (Python package manager)
  • An account on the PureAI platform with a valid API key

Installation via pip

The simplest way to install PureRouter is using pip:
pip install purerouter

Verifying Installation

To verify that PureRouter was installed correctly, you can run:
pip list | grep purerouter
You should see the purerouter package listed with its current version.

Initial Configuration

After installation, you’ll need to configure the client with your API key:
from purerouter import PureRouter
from purerouter.types import InferRequest, InvokeRequest

# Initialize the client with your router API key
client = PureRouter(router_key="your-api-key-here")

# Test the connection
response = client.router.infer(InferRequest(prompt="Hello, world!", profile="economy"))
print(response.output_text)
You need to obtain a valid API key from the PureAI platform. This key allows access to the different routing profiles and deployments configured in your account.

Next Steps

Now that you have installed and configured PureRouter, you can: