FlockMTL Using Azure
Before starting, ensure you have followed the Getting Started guide to setup FlockMTL. Next you need to get the necesary credentials to use Azure API check the Microsoft Azure Page.
Azure Provider Setup
To use the Azure API, you need only to do two required steps:
- First, create a secret with your Azure API key, resource name, and API version. You can do this by running the following SQL command:
CREATE SECRET (
TYPE AZURE_LLM,
API_KEY 'your-key-here',
RESOURCE_NAME 'resource-name',
API_VERSION 'api-version'
);
The azure_endpoint will be reconstruct from the RESOURCE_NAME param. If your azure_endpoint is https://my-personal-resource-name.openai.azure.com
, RESOURCE_NAME should be my-personal-resource-name
.
- Create your Azure model in the model manager. Make sure that the name of the model is unique. You can do this by running the following SQL command:
CREATE MODEL(
'QuackingModel',
'gpt-4o',
'azure',
{"context_window": 128000, "max_output_tokens": 16384}
);
- Now you simply use FlockMTL with Azure provider. Here's a small query to run to test if everything is working:
SELECT llm_complete(
{'model_name': 'QuackingModel'},
{'prompt': 'Talk like a duck 🦆 and write a poem about a database 📚'}
);