foundry-cloud-ts
purpose
Using Azure AI Foundry (cloud) and the Azure AI model catalog for serverless model inference. Covers Model-as-a-Service (MaaS) deployments, the Azure AI Inference SDK, GitHub Models, and connecting to Foundry-hosted models from TypeScript.
rules
- Azure AI Foundry provides serverless model endpoints (Model-as-a-Service). No GPU provisioning needed — deploy a model from the catalog and get an HTTPS endpoint with pay-per-token billing. Available models include Phi-4, Llama, Mistral, Cohere, and more. learn.microsoft.com/azure/ai-studio/how-to/deploy-models-serverless
- MaaS endpoints are OpenAI-compatible. The deployed endpoint exposes
/v1/chat/completionswith the standard OpenAI request/response format. Use theopenainpm package with a custombaseURLand the endpoint's API key. learn.microsoft.com/azure/ai-studio/reference/reference-model-inference-chat-completions - Alternatively, use
@azure-rest/ai-inferencefor the Azure AI Inference SDK. This TypeScript SDK provides a typed client for Azure AI model endpoints.npm install @azure-rest/ai-inference. It supports chat completions, embeddings, and image generation. learn.microsoft.com/azure/ai-studio/reference/reference-model-inference-api - Authentication uses either API key or Entra ID token. MaaS endpoints accept an API key in the
Authorization: Bearer <key>header. For managed identity, use@azure/identityto get a token. learn.microsoft.com/azure/ai-studio/how-to/deploy-models-serverless - GitHub Models provides free-tier access to the same model catalog. Use
https://models.inference.ai.azure.comas the base URL with a GitHub personal access token as the API key. Great for prototyping before deploying to your own Azure subscription. docs.github.com/en/github-models - Deploy models via the Azure AI Foundry portal or CLI. In the portal: AI Foundry → Model catalog → Deploy. Via CLI:
az cognitiveservices account deployment createfor Azure OpenAI models, or use the AI Foundry portal for MaaS models. learn.microsoft.com/azure/ai-studio/how-to/deploy-models-serverless