Skip to content

Portkey experiment#11

Open
suraj9741 wants to merge 2 commits into
mainfrom
portkey-experiment
Open

Portkey experiment#11
suraj9741 wants to merge 2 commits into
mainfrom
portkey-experiment

Conversation

@suraj9741

Copy link
Copy Markdown

PR Overview

Portkey AI Gateway POC — Cloud & Local self-hosted evaluation

What this adds

A fully runnable evaluation of Portkey AI Gateway across two deployment tracks:


Track 1 — Cloud (portkey-poc/)

  • 8 individual demo scripts covering: basic completion, multi-turn chat, streaming, fallback, load balancing, retry+timeout, guardrails, and simple cache
  • cloud_demo.py — automated all-in-one runner (8/8 pass)
  • run_all.py — supports --only / --skip flags
  • Demo 6 (Retry): retry actually fires — uses @test/invalid-trigger-fallback + 400 in on_status_codes; proven via timing (214ms vs 7209ms) and x-portkey-retry-attempt-count: -1 header
  • Demo 7 (Guardrails): Portkey native API — client.guardrails.create() → slug → before_request_hooks; not custom Python regex
  • Demo 8 (Cache): cache.mode: simple with real HIT/MISS verification via resp.get_headers()['cache-status']; 18x speedup on hits

Track 2 — Local self-hosted (portkey-local-poc/)

  • 6 demo scripts via single Docker container (portkeyai/gateway:latest on port 8787)
  • local_demo.py + team_demo.py — automated and presentation-mode runners
  • Fixed docker-compose.yml: empty volumes: block caused startup crash; LOG_STORE=local silently ignored in v1.15.2+ — removed dead env vars and ./logs mount
  • Observability via built-in UI at http://localhost:8787/public/

Docs

  • EXPERIMENT_README.md — OSS vs Cloud feature comparison, self-hosted limitations clearly marked
  • portkey-poc/README.md — 8 demos, retry proof, native guardrail API, cache header verification
  • portkey-local-poc/README.md — 6 demos, Docker setup, UI-based observability
  • experiments/portkey/README.md — updated Dashboard and Usage sections

Key findings

Feature OSS Local Cloud (free) Cloud (paid)
Routing / fallback / retry
Request viewer ✅ localhost:8787/public/ ✅ app.portkey.ai
Simple cache
Guardrails (real blocking)
Semantic cache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant