npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

azure-architecture-ai-toolkit

v0.0.2

Published

A TypeScript helper library that uses AI services to help with Azure architecture-related functionality.

Readme

Azure Architecture AI Toolkit

The Azure Architecture AI toolkit is a helper library, written in TypeScript, that uses Azure Custom Vision, and Azure OpenAI services to help with Azure architecture-related functionality.

Installation

npm install azure-architecture-ai-toolkit

Once the toolkit is installed create a new environment file called .env and add the following:

OPEN_AI_API_KEY=<openai-api-key>
OPEN_AI_INSTANCE=<openai-instance-name>
OPEN_AI_API_VERSION=<openai-api-version>
OPEN_AI_DEPLOYMENT=<openai-deployment-name>
CUSTOM_VISION_PREDICTION_KEY=<custom-vision-prediction-api-key>
CUSTOM_VISION_PREDICTION_INSTANCE=<custom-vision-prediction-instance-name>
CUSTOM_VISION_PROJECT_ID=<custom-vision-project-id>
CUSTOM_VISION_PUBLISH_ITERATION_NAME=<custom-vision-model-iteration-name>

In your code, you can then initialise the toolkit as follows:

import dotenv from "dotenv";
import * as toolkit from "azure-architecture-ai-toolkit";

// Configure dotenv
dotenv.config();

// Initialise the toolkit
toolkit.initialise({
	openAIApiKey: process.env.OPEN_AI_API_KEY!,
	openAIInstance: process.env.OPEN_AI_INSTANCE!,
	openAIApiVersion: process.env.OPEN_AI_API_VERSION!,
	openAIDeployment: process.env.OPEN_AI_DEPLOYMENT!,
	customVisionPredictionKey: process.env.CUSTOM_VISION_PREDICTION_KEY!,
	customVisionPredictionInstance: process.env.CUSTOM_VISION_PREDICTION_INSTANCE!,
	customVisionPublishIterationName: process.env.CUSTOM_VISION_PUBLISH_ITERATION_NAME!,
	customVisionProjectId: process.env.CUSTOM_VISION_PROJECT_ID!,
	customVisionDetectionThreshold: 35,
	customVisionOverlapThreshold: 3
});

Currently, the library supports the following functionality:

1. Azure Architecture Diagram Service Detection

This functionality allows you to detect the Azure services used in an architecture diagram. To use this functionality, you need to have an Azure Cognitive Services Custom Vision API key, and a deployed model that has been trained to detect Azure service icons and connectors.

Azure Service Detection

1.1. Detect Azure Services in an Architecture Diagram

export const detectServicesFromDiagram = async (pathToFile: string) => {
    const result = await toolkit.detectServicesFromDiagram(pathToFile);
    console.log(result);
}

This function takes in a path to a file, and returns a JSON array of Azure services detected in the diagram and connectors between them.

2. Azure Architecture Explanation

This functionality allows you to generate a plain English explanation for an architecture diagram. This function internally uses the detection functionality above, and then uses Azure OpenAI to generate an explanation of the diagram. To use this functionality, you need to have an OpenAI API key.

2.1. Generate an Explanation from an Architecture Diagram

This function takes in a path to a file, either local or remotely hosted, and returns a plain English explanation of the diagram.

export const explainDiagram = async (pathToFile: string) => {
    const result = await toolkit.explainDiagram(pathToFile);
    console.log(result);
}

This would output something like the following:

This architecture diagram shows a system that consists of several Azure services.

At the center of the diagram is an API Management service, which is connected to two other objects - a Function App and a User. The connection lines indicate that data flows from the User to the API Management service and from the API Management service to the Function App.

The Function App is also connected to two other services - a Key Vault, and a Cosmos DB. The Function App receives data from the API Management service, and then sends > data to the Key Vault and Cosmos DB. The Key Vault is connected to the Function App, indicating that it stores sensitive information that is accessed by both services.

The Cosmos DB is connected to the Function App, indicating that the Function App retrieves data from or sends data to the Cosmos DB.

Overall, this diagram represents a system architecture where data flows from the API Management service to the Function App and User, and the Function App interacts with the Key Vault and Cosmos DB.

3. Azure Architecture Infrastructure-as-Code Generation

This functionality allows you to generate either a Terraform or Bicep code template from the specified architecture diagram. This function internally uses the detection functionality above, and then uses Azure OpenAI to generate IaC for the services the diagram. To use this functionality, you need to have an OpenAI API key.

3.1. Generate Terraform IaC from an Architecture Diagram

This function takes in a path to a file, either local or remotely hosted, and returns a Terraform template for the services detected within the architecture diagram.

export const generateCodeFromDiagram = async (pathToFile: string) => {
    const result = await toolkit.generateCodeFromDiagram(pathToFile, toolkit.IaCLanguage.Terraform);
    console.log(result);
}

3.2. Generate Bicep IaC from an Architecture Diagram

This function takes in a path to a file, either local or remotely hosted, and returns a Bicep template for the services detected within the architecture diagram.

export const generateCodeFromDiagram = async (pathToFile: string) => {
    const result = await toolkit.generateCodeFromDiagram(pathToFile, toolkit.IaCLanguage.Bicep);
    console.log(result);
}