This page describes to run OpenChat Playground (OCP) with GitHub Models integration.
-
Get the repository root.
# bash/zsh REPOSITORY_ROOT=$(git rev-parse --show-toplevel)
# PowerShell $REPOSITORY_ROOT = git rev-parse --show-toplevel
-
Make sure you are at the repository root.
cd $REPOSITORY_ROOT
-
Add GitHub Personal Access Token (PAT) for GitHub Models connection. Make sure you should replace
{{GH_PAT}}with your GitHub PAT.# bash/zsh dotnet user-secrets --project $REPOSITORY_ROOT/src/OpenChat.PlaygroundApp \ set GitHubModels:Token "{{GH_PAT}}"
# PowerShell dotnet user-secrets --project $REPOSITORY_ROOT/src/OpenChat.PlaygroundApp ` set GitHubModels:Token "{{GH_PAT}}"
For more details about GitHub PAT, refer to the doc, Managing your personal access tokens.
-
Run the app. The default model OCP uses is GPT-4o mini.
# bash/zsh dotnet run --project $REPOSITORY_ROOT/src/OpenChat.PlaygroundApp -- \ --connector-type GitHubModels
# PowerShell dotnet run --project $REPOSITORY_ROOT/src/OpenChat.PlaygroundApp -- ` --connector-type GitHubModels
Alternatively, if you want to run with a different model, say Grok 3 mini, other than the default one, you can specify it as an argument:
# bash/zsh dotnet run --project $REPOSITORY_ROOT/src/OpenChat.PlaygroundApp -- \ --connector-type GitHubModels \ --model xai/grok-3-mini
# PowerShell dotnet run --project $REPOSITORY_ROOT/src/OpenChat.PlaygroundApp -- ` --connector-type GitHubModels ` --model xai/grok-3-mini
-
Open your web browser, navigate to
http://localhost:5280, and enter prompts.
-
Make sure you are at the repository root.
cd $REPOSITORY_ROOT
-
Build a container.
docker build -f Dockerfile -t openchat-playground:latest . -
Get GitHub PAT.
# bash/zsh TOKEN=$(dotnet user-secrets --project ./src/OpenChat.PlaygroundApp list --json | \ sed -n '/^\/\//d; p' | jq -r '."GitHubModels:Token"')
# PowerShell $TOKEN = (dotnet user-secrets --project ./src/OpenChat.PlaygroundApp list --json | ` Select-String -NotMatch '^//(BEGIN|END)' | ConvertFrom-Json).'GitHubModels:Token'
-
Run the app.
# bash/zsh - From locally built container docker run -i --rm -p 8080:8080 openchat-playground:latest \ --connector-type GitHubModels \ --token $TOKEN
# PowerShell - From locally built container docker run -i --rm -p 8080:8080 openchat-playground:latest ` --connector-type GitHubModels ` --token $TOKEN
# bash/zsh - From GitHub Container Registry docker run -i --rm -p 8080:8080 ghcr.io/aliencube/open-chat-playground/openchat-playground:latest \ --connector-type GitHubModels \ --token $TOKEN
# PowerShell - From GitHub Container Registry docker run -i --rm -p 8080:8080 ghcr.io/aliencube/open-chat-playground/openchat-playground:latest ` --connector-type GitHubModels ` --token $TOKEN
Alternatively, if you want to run with a different model, say Grok 3 mini, other than the default one, you can specify it as an argument:
# bash/zsh - From locally built container docker run -i --rm -p 8080:8080 openchat-playground:latest \ --connector-type GitHubModels \ --token $TOKEN \ --model xai/grok-3-mini
# PowerShell - From locally built container docker run -i --rm -p 8080:8080 openchat-playground:latest ` --connector-type GitHubModels ` --token $TOKEN ` --model xai/grok-3-mini
# bash/zsh - From GitHub Container Registry docker run -i --rm -p 8080:8080 ghcr.io/aliencube/open-chat-playground/openchat-playground:latest \ --connector-type GitHubModels \ --token $TOKEN \ --model xai/grok-3-mini
# PowerShell - From GitHub Container Registry docker run -i --rm -p 8080:8080 ghcr.io/aliencube/open-chat-playground/openchat-playground:latest ` --connector-type GitHubModels ` --token $TOKEN ` --model xai/grok-3-mini
-
Open your web browser, navigate to
http://localhost:8080, and enter prompts.
-
Make sure you are at the repository root.
cd $REPOSITORY_ROOT
-
Login to Azure.
# Login to Azure Dev CLI azd auth login -
Check login status.
# Azure Dev CLI azd auth login --check-status -
Initialize
azdtemplate.azd init
NOTE: You will be asked to provide environment name for provisioning.
-
Get GitHub PAT.
# bash/zsh TOKEN=$(dotnet user-secrets --project ./src/OpenChat.PlaygroundApp list --json | \ sed -n '/^\/\//d; p' | jq -r '."GitHubModels:Token"')
# PowerShell $TOKEN = (dotnet user-secrets --project ./src/OpenChat.PlaygroundApp list --json | ` Select-String -NotMatch '^//(BEGIN|END)' | ConvertFrom-Json).'GitHubModels:Token'
-
Set GitHub PAT to azd environment variables.
azd env set GH_MODELS_TOKEN $TOKEN
The default model OCP uses is GPT-4o mini. If you want to run with a different model, say Grok 3 mini, other than the default one, add it to azd environment variables.
azd env set GH_MODELS_MODEL "xai/grok-3-mini"
-
Set the connector type to
GitHubModels.azd env set CONNECTOR_TYPE "GitHubModels"
-
Run the following commands in order to provision and deploy the app.
azd up
NOTE: You will be asked to provide Azure subscription and location for deployment.
Once deployed, you will be able to see the deployed OCP app URL.
-
Open your web browser, navigate to the OCP app URL, and enter prompts.
-
Clean up all the resources.
azd down --force --purge