Providers & Models
Azure OpenAI

Azure OpenAI

Before you start

  1. Head over to Azure OpenAI (opens in a new tab) and create an instance if you don't have one.
  2. Create a new model deployment on Azure AI and configure it as you wish.
  3. Set the following environment variables:
  • AZURE_OPENAI_ENDPOINT - your Azure OpenAI endpoint
  • AZURE_OPENAI_API_KEY - your Azure OpenAI API key

Usage

import { UniLLM } from 'unillm';
 
/*
  Make sure the following environment variables are set:
AZURE_OPENAI_ENDPOINT - your Azure OpenAI endpoint
AZURE_OPENAI_API_KEY - your Azure OpenAI API key
*/ // Setup UniLLM const unillm = new UniLLM(); // Use any LLM provider and model const response = await unillm.createChatCompletion("azure/openai/<deployment-name>", { temperature: 0, messages: [ { role: "user", content: "How are you?" } ] })
Last updated on