Skip to main content
  1. Enhanced Logging: Track API usage with detailed insights.
  2. Production Reliability: Automated fallbacks, load balancing, and caching.
  3. Continuous Improvement: Collect and apply user feedback.
  4. Enhanced Fine-Tuning: Combine logs & user feedback for targetted fine-tuning.

1.1 Setup & Logging

  1. Set $ export OPENAI_API_KEY=ANYSCALE_API_KEY
  2. Obtain your Portkey API Key.
  3. Switch to Portkey Gateway URL: https://api.portkey.ai/v1/proxy
See full logs of requests (latency, cost, tokens)—and dig deeper into the data with their analytics suite.

1.2. Enhanced Observability

  • Trace requests with single id.
  • Append custom tags for request segmenting & in-depth analysis.
Just add their relevant headers to your request:
Here’s how your logs will appear on your Portkey dashboard:

2. Caching, Fallbacks, Load Balancing

  • Fallbacks: Ensure your application remains functional even if a primary service fails.
  • Load Balancing: Efficiently distribute incoming requests among multiple models.
  • Semantic Caching: Reduce costs and latency by intelligently caching results.
Toggle these features by saving Configs (from the Portkey dashboard > Configs tab). If we want to enable semantic caching + fallback from Llama2 to Mistral, your Portkey config would look like this:
Now, just send the Config ID with x-portkey-config header:
For more on Configs and other gateway feature like Load Balancing, check out the docs.

3. Collect Feedback

Gather weighted feedback from users and improve your app:

4. Continuous Fine-Tuning

Once you start logging your requests and their feedback with Portkey, it becomes very easy to 1️) Curate & create data for fine-tuning, 2) Schedule fine-tuning jobs, and 3) Use the fine-tuned models! Fine-tuning is currently enabled for select orgs - please request access on Portkey Discord and we’ll get back to you ASAP.

Conclusion

Integrating Portkey with Anyscale helps you build resilient LLM apps from the get-go. With features like semantic caching, observability, load balancing, feedback, and fallbacks, you can ensure optimal performance and continuous improvement. Read full Portkey docs here. | Reach out to the Portkey team.
Last modified on April 8, 2026