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';
 
/*
  #SETUP#
*/
 
// Setup UniLLM
const unillm = new UniLLM();
 
// Use any LLM provider and model
const response = await unillm.createChatCompletion("#MODEL#", {
  temperature: 0,
  messages: [
    {
      role: "user",
      content: "How are you?"
    }
  ]
})