Segmind
Portkey + Segmind
With Portkey, you can
Connect to 150+ models through a unified API,
View 40+ metrics & logs for all requests,
Enable semantic cache to reduce latency & costs,
Implement automatic retries & fallbacks for failed requests,
Add custom tags to requests for better tracking and analysis and more.
Display Image ( Utility function )
Quickstart
Since Portkey is fully compatible with the OpenAI signature, you can connect to the Portkey AI Gateway through OpenAI Client.
Set the
base_url
asPORTKEY_GATEWAY_URL
Add
default_headers
to consume the headers needed by Portkey using thecreateHeaders
helper method.
You will need Portkey and Segmind API keys to run this notebook.
With OpenAI Client
With Portkey Client
Optional
Advanced Routing - Fallbacks
Optional
Advanced Routing - FallbacksThe Fallback feature allows you to specify a list of providers/models in a prioritized order. If the primary LLM fails to respond or encounters an error, Portkey will automatically fallback to the next LLM in the list, ensuring your application's robustness and reliability.
Monitoring your Requests
Using Portkey you can monitor your Segmind requests and track tokens, cost, latency, and more.
Last updated