We've made it quick and easy to get access to Azure OpenAI models for the duration of Hack Together!
By using our Azure OpenAI Proxy service you'll get access to keys and endpoints that work just like the real ones you get from using the Azure Portal and Azure OpenAI Studio to deploy your own models.
When you get access to Azure OpenAI yourself, all you need to do is switch over your endpoints and keys to get up and running on your own resources.
Here you'll see how to get started by gaining access to our proxy server. Then see how to get hacking using the endpoint, key, and models. You will also find some examples here for each of the models and how to use them, for Python and .NET.
Got Stuck? If you have any improvements for these instructions let us know in the GitHub Issues so we can make them better for everyone.
To gain access:
-
Register for this event at this URL: https://aka.ms/Hacktogether-AI-register
-
Once logged in, you have access to your API key for this event, click the copy icon. Keep your key handy, for the following steps and for your hacking!
-
Go to the AI Proxy Playground at this URL: https://aka.ms/Hacktogether-AI-playground
-
Enter your API key in the text box in the top-right corner and click Authorize
-
You should now see the event name "Hack Together Fabric AI" in the top-right corner!
-
You're ready to test your set up, first you need to choose a model in the pannel on the right-hand side. GTP models are used for running/testing in the chat, choose one to get started.
We recomend one of the GTP-35 models just for the purposes of testing the playground quickly.
-
You're ready to go, write a message in the Chat Session. You should receive a message back in a few seconds!
If you get an error when trying out the chat feature try refreshing and if that fails, hard refreshing (CTRL + SHIFT + R) your browser. If it doesn't work after a few times take a screen shot of the error and leave us a message in the GitHub Issues.
To get hacking with AI this event you'll need both the endpoint and key to put into your own code creations!
Endpoint: https://polite-ground-030dc3103.4.azurestaticapps.net/api/v1
Key: Use the key you got in step 3 above.
Never commit your keys to a Git repository or share them publicly.
If at any point your code runs and a request returns without content, run your code again (maybe a couple of times) and it should work. This is the expected behaviour of Azure OpenAI some of the time.
For this event you have access to the four models below. You'll need to use the model names from the table below in your code. You have up to 2000 requests per model per day.
Model | Model Name | Docs | Example (Python)* | Example (.NET)** |
---|---|---|---|---|
GTP-3.5 | gtp-35-turbo | GPT-3.5 Docs | Azure OpenAI Chat - Python | Azure OpenAI Chat - .NET |
GTP-3.5 (Turbo) | gtp-35-turbo-16k | GTP-3.5 Docs | As above, change model name | As above, change model name |
GTP-4 | gtp-4 | GTP-4 Docs | As above, change model name | As above, change model name |
Embeddings | text-embedding-ada-002 | Embeddings Docs | Azure OpenAI Embeddings - Python | Azure OpenAI Embeddings - .NET |
DALL-E 4 | dall-e-3 | DALL-E Docs | Azure OpenAI DALL-E - Python | Azure OpenAI DALL-E - .NET |
The models we are using are all hosted in the Sweden Central region. You won't need that information for your hacking purposes.
For more guidance on using Python with Azure OpenAI you can check out the OpenAI Python API library on PyPi for the docs, how to set up your environment variables, and for some simple examples.
You'll need to add two environment variables to run the examples: ENDPOINT_URL and API_KEY. The PyPi docs give a good example on how to set up a .env file to store your keys and endpoints and to use dot_env the library to access your keys and endpoints (dot_env is used in the Python examples listed in the table).
For more guidance on using .NET with Azure OpenAI, check out the Azure OpenAI client Library for .NET.
To run the examples from the table above you will need to add two environment variables: YOUR_AZURE_OPENAI_PROXY_URL , set this to the endpoint provided above. YOUR_EVENT_AUTH_TOKEN , set this to your event key.