Expanding the AI Gateway with Google Vertex AI Integration
At Portkey.ai, our mission is to empower developers and businesses to leverage the full potential of artificial intelligence in their applications. We're thrilled to announce a significant milestone in this journey: the integration of Google's Vertex AI into our AI gateway. This integration expands your options for building intelligent applications by providing access to even more powerful language models, including the highly regarded Gemini model series.
The AI gateway is designed to simplify the process of integrating AI models into your projects, and with the addition of Vertex AI, you now have access to over 250 models from various providers. This means you can explore and experiment with a wide range of state-of-the-art models to find the perfect fit for your specific use case, all through a single, consistent OpenAI-like API.
Integrating Vertex AI into your applications via Portkey is straightforward.
First, install our SDK:
npm install --save portkey-ai
Next, initialize the SDK with your Vertex virtual key (where your Vertex AI creds are saved):
import Portkey from 'portkey-ai';
const portkey = new Portkey({
apiKey: "PORTKEY_API_KEY",
virtualKey: "VIRTUAL_KEY",
});
Once you've completed these steps, you can start invoking chat completions with Gemini models:
const chatCompletion = await portkey.chat.completions.create({
messages: [{ role: 'user', content: 'Say this is a test' }],
model: 'gemini-pro',
},{
authorization: "vertex ai access token here"
});
console.log(chatCompletion.choices);
We prioritize the security of your API keys and support OAuth2 authentication for Vertex AI requests, ensuring that your integrations remain secure and protected.
One of the key features of Portkey.ai is our Prompt Library, which allows you to manage, test, and refine prompts for all models in the Vertex AI model garden. This feature empowers you to optimize your prompts for your specific use case, ensuring that you get the best possible results from your AI integrations.
For developers who require more granular control over their integrations, Portkey.ai also supports making requests directly to Vertex AI without using virtual keys. By specifying the region, project ID, and access token in your requests, you can fine-tune your Vertex AI integrations to meet your unique requirements.
Explore full Vertex AI docs here:
With support for a wide range of models, full-stack observability, and a consistent API, we strive to simplify the process of integrating AI into your applications, allowing you to focus on building innovative and impactful solutions!