Anyscale
Portkey helps bring Anyscale APIs to production with its abstractions for observability, fallbacks, caching, and more. Use the Anyscale API through Portkey for:
Enhanced Logging: Track API usage with detailed insights.
Production Reliability: Automated fallbacks, load balancing, and caching.
Continuous Improvement: Collect and apply user feedback.
Enhanced Fine-Tuning: Combine logs & user feedback for targetted fine-tuning.
1.1 Setup & Logging
Set
$ export OPENAI_API_KEY=ANYSCALE_API_KEY
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:
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!
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.
Last updated