MemberJunction AI provider for Azure OpenAI Service. This package provides both LLM and embedding capabilities through Azure's enterprise-grade deployment of OpenAI models, implementing BaseLLM and BaseEmbeddings from @memberjunction/ai.
Architecture
graph TD
A["AzureLLM (Provider)"] -->|extends| B["BaseLLM (@memberjunction/ai)"]
C["AzureEmbedding (Provider)"] -->|extends| D["BaseEmbeddings (@memberjunction/ai)"]
A -->|wraps| E["Azure AI Inference REST Client"]
C -->|wraps| E
A -->|authenticates via| F["API Key or Azure AD (Entra ID)"]
B -->|registered via| G["@RegisterClass"]
D -->|registered via| G
style A fill:#7c5295,stroke:#563a6b,color:#fff
style C fill:#7c5295,stroke:#563a6b,color:#fff
style B fill:#2d6a9f,stroke:#1a4971,color:#fff
style D fill:#2d6a9f,stroke:#1a4971,color:#fff
style E fill:#2d8659,stroke:#1a5c3a,color:#fff
style F fill:#b8762f,stroke:#8a5722,color:#fff
style G fill:#b8762f,stroke:#8a5722,color:#fff
Features
Chat Completions: Full support for Azure-hosted language models including GPT-4, GPT-3.5-Turbo, and Phi-4
Streaming Support: Real-time streaming responses for enhanced user experience
Text Embeddings: Generate vector embeddings for semantic search and similarity matching
Dual Authentication: Support for both API key and Azure Active Directory (Entra ID) authentication
Text Processing: Built-in text summarization and classification capabilities
Type Safety: Full TypeScript support with comprehensive type definitions
Factory Pattern: Seamless integration with MemberJunction's AI factory system
Installation
npminstall@memberjunction/ai-azure
Configuration
Prerequisites
An Azure subscription with Azure AI or Azure OpenAI service deployed
Either an API key for your Azure AI resource or Azure AD credentials