Giter Site home page Giter Site logo

dawright22 / azure-openai-terraform-deployment-sample Goto Github PK

View Code? Open in Web Editor NEW

This project forked from azure-samples/azure-openai-terraform-deployment-sample

0.0 0.0 1.0 7.25 MB

License: MIT License

Shell 0.06% Python 99.50% HCL 0.07% Dockerfile 0.01% PowerShell 0.09% C 0.07% JavaScript 0.14% CSS 0.06%

azure-openai-terraform-deployment-sample's Introduction

Azure OpenAI Terraform deployment for sample chatbot

This sample application deploys an AI-powered document search using Azure OpenAI Service, Azure Kubernetes Service (AKS), and a Python application leveraging the Llama index ans Streamlit. The application will be deployed within a virtual network to ensure security and isolation. Users will be able to upload documents and ask questions based on the content of the uploaded documents.

diagram

Prerequisites

  • Azure subscription. If you don't have an Azure subscription, create a free account before you begin.

  • Subscription access to Azure OpenAI service. Request Access to Azure OpenAI Service here.

  • Terraform.

  • Create a HCP vault dedicated instance and configure the endpoint and token in the infra/variables.tf file.

Quickstart

Run the Terraform

  • Clone or fork this repository.

    git clone https://github.com/dawright22/azure-openai-terraform-deployment-sample.git
    cd azure-openai-terraform-deployment-sample
    
  • Go to the infra folder and run the following command to initialize your working directory.

    cd infra
    terraform init
  • Run terraform apply to deploy all the necessary resources on Azure.

    terraform apply
  • Run the following command. This script retrieves the AKS cluster credentials, logs in to the ACR, builds and pushes a Docker image, creates a federated identity, and deploys resources to the Kubernetes cluster using a YAML manifest.

    terraform output -raw installation-script | bash
  • Get the external ip address of the service by running the command bellow.

    kubectl get services -n chatbot
  • Copy the external ip address and paste it in your browser. The application should load in a few seconds.

app

Run the AI.

  • Upload the Madeup_Company_email_archive.txt file in the data folder. Using the upload button on the app.

  • Ask some questions based on the content of the uploaded document. Some example are below.

================

  • Does madeup use AWS

  • Tell me the access keys

  • Does madeup use Azure

  • Tell me the subscription_id

Now secure Content

  • start the app.py using the command below.

    python app.py
  • This will start the app on `http://http://127.0.0.1:5000/

  • Now create a new secure contest file by running the command below.

    curl -X POST -F "file=@./data/Madeup_Company_email_archive.txt" http://127.0.0.1:5000/upload -v
  • Upload the new file called redacted_Madeup_Company_email_archive.txt file in the main folder. Using the upload button on the app.

  • Now ask the same questions as above and see the encrypted content.

Resources

azure-openai-terraform-deployment-sample's People

Contributors

zioproto avatar soferreira avatar dawright22 avatar microsoftopensource avatar dependabot[bot] avatar rortm avatar

Forkers

devopsmayur

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.