Skip to main content
MindsDB connects data sources and LLMs for AI automation. Portkey adds:
  • 1600+ LLMs — Access any provider through MindsDB
  • Observability — Track costs, latency, and usage
  • Reliability — Caching, routing, guardrails via Configs

Prerequisites

  1. Install MindsDB via Docker or Docker Desktop
  2. Install Portkey dependencies per MindsDB instructions
  3. Get your Portkey API key

Setup

1

Create AI Engine

CREATE ML_ENGINE portkey_engine
FROM portkey
USING
    portkey_api_key = 'PORTKEY_API_KEY',
    config = 'pc-your-config-id';
Use Configs to add guardrails, caching, conditional routing, and more.
2

Create Model

CREATE MODEL portkey_model
PREDICT answer
USING
    engine = 'portkey_engine',
    temperature = 0.2;
3

Query

SELECT question, answer
FROM portkey_model
WHERE question = 'Where is Stockholm located?';
Output:
+-----------------------------+--------------------------------------------------------------------------------+
| question                    | answer                                                                         |
+-----------------------------+--------------------------------------------------------------------------------+
| Where is Stockholm located? | Stockholm is the capital of Sweden, located on the south-central east coast... |
+-----------------------------+--------------------------------------------------------------------------------+

Next Steps