Skip to content
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
4714dd8
refactor: split UI logic in ChatHeader.razor
qoweh Sep 13, 2025
04735cc
test: add integration tests for NewChat button and icon visibility
qoweh Sep 13, 2025
a8f0a7d
Merge remote-tracking branch 'upstream/main'
qoweh Sep 13, 2025
6e68171
Merge remote-tracking branch 'origin/main'
qoweh Sep 18, 2025
1f5783c
Merge branch 'aliencube:main' into main
qoweh Sep 22, 2025
5094a9f
Merge branch 'aliencube:main' into main
qoweh Sep 23, 2025
8ed4bfd
Merge branch 'aliencube:main' into main
qoweh Sep 25, 2025
39354bc
Merge branch 'aliencube:main' into main
qoweh Sep 28, 2025
cf64868
Merge branch 'aliencube:main' into main
qoweh Oct 1, 2025
6cfef60
Merge branch 'aliencube:main' into main
qoweh Oct 5, 2025
aeb63e8
Merge branch 'aliencube:main' into main
qoweh Oct 8, 2025
1e225a0
Merge branch 'main' into feat/261-ConnectorImplementation-Inheritance…
qoweh Oct 13, 2025
bb8dcbf
feat: Add support for Anthropic API integration and update documentation
qoweh Oct 13, 2025
ebf7b2b
feat: Add documentation for running OpenChat Playground with Anthropi…
qoweh Oct 13, 2025
e06184b
feat: Update default model references to Claude Sonnet 4 and adjust a…
qoweh Oct 13, 2025
e3dba70
feat: Add support for Anthropic connector in LanguageModelConnector
qoweh Oct 13, 2025
15881b4
feat: Implement Anthropic connector for LanguageModel integration
qoweh Oct 14, 2025
0708685
feat: Enhance AnthropicConnector with improved error handling and add…
qoweh Oct 14, 2025
65b2d5f
Adds documentation for Anthropic connector
qoweh Oct 14, 2025
c625f11
Updates documentation to refer to Anthropic models
qoweh Oct 14, 2025
9bc001b
feat: Refactor GetChatClientAsync to improve API client initializatio…
qoweh Oct 14, 2025
4842bc8
Merge branch 'aliencube:main' into main
qoweh Oct 16, 2025
24c3dd5
Merge branch 'main' into feat/261-ConnectorImplementation-Inheritance…
qoweh Oct 16, 2025
d23c92b
feat: add max_tokens parameter for Anthropic in appsettings.json
qoweh Oct 16, 2025
92c3eed
feat: add property MaxTokens for Anthropic in AnthropicSettings
qoweh Oct 16, 2025
604dcf3
Merge remote-tracking branch 'origin/main' into feat/261-ConnectorImp…
qoweh Oct 16, 2025
1a58fb7
fix: temporarily disable Anthropic
qoweh Oct 16, 2025
9c51809
test: skip all Anthropic connector tests until enabled
qoweh Oct 16, 2025
06efab1
refactor: update documentation to remove "Claude" references from Ant…
qoweh Oct 18, 2025
99b7de9
Merge branch 'main' into feat/261-ConnectorImplementation-Inheritance…
qoweh Oct 18, 2025
09ad176
feat: add option MaxTokens for parsing option
qoweh Oct 20, 2025
cc490d7
Merge branch 'main' into feat/261-ConnectorImplementation-Inheritance…
qoweh Oct 20, 2025
8032506
feat: add constant for '--max-tokens' command-line argument
qoweh Oct 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/azure-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }}
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
GH_MODELS_TOKEN: ${{ secrets.GH_MODELS_TOKEN }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

steps:
Expand Down Expand Up @@ -133,6 +134,7 @@ jobs:
shell: bash
env:
GitHubModels__Token: ${{ env.GH_MODELS_TOKEN }}
Anthropic__ApiKey: ${{ env.ANTHROPIC_API_KEY }}
OpenAI__ApiKey: ${{ env.OPENAI_API_KEY }}
run: |
azd provision --no-prompt
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Open Chat Playground (OCP) is a web UI that is able to connect virtually any LLM
- [ ] [Foundry Local](https://learn.microsoft.com/azure/ai-foundry/foundry-local/what-is-foundry-local)
- [x] [Hugging Face](https://huggingface.co/docs)
- [ ] [Ollama](https://github.com/ollama/ollama/tree/main/docs)
- [ ] [Anthropic](https://docs.anthropic.com)
- [x] [Anthropic](https://docs.anthropic.com)
- [ ] [Naver](https://api.ncloud-docs.com/docs/ai-naver-clovastudio-summary)
- [x] [LG](https://github.com/LG-AI-EXAONE)
- [x] [OpenAI](https://openai.com/api)
Expand Down Expand Up @@ -63,6 +63,7 @@ Open Chat Playground (OCP) is a web UI that is able to connect virtually any LLM
- [Use Azure AI Foundry](./docs/azure-ai-foundry.md#run-on-local-machine)
- [Use GitHub Models](./docs/github-models.md#run-on-local-machine)
- [Use Hugging Face](./docs/hugging-face.md#run-on-local-machine)
- [Use Anthropic](./docs/anthropic.md#run-on-local-machine)
- [Use LG](./docs/lg.md#run-on-local-machine)
- [Use OpenAI](./docs/openai.md#run-on-local-machine)

Expand All @@ -71,6 +72,7 @@ Open Chat Playground (OCP) is a web UI that is able to connect virtually any LLM
- [Use Azure AI Foundry](./docs/azure-ai-foundry.md#run-in-local-container)
- [Use GitHub Models](./docs/github-models.md#run-in-local-container)
- [Use Hugging Face](./docs/hugging-face.md#run-in-local-container)
- [Use Anthropic](./docs/anthropic.md#run-in-local-container)
- [Use LG](./docs/lg.md#run-in-local-container)
- [Use OpenAI](./docs/openai.md#run-in-local-container)

Expand All @@ -79,6 +81,7 @@ Open Chat Playground (OCP) is a web UI that is able to connect virtually any LLM
- [Use Azure AI Foundry](./docs/azure-ai-foundry.md#run-on-azure)
- [Use GitHub Models](./docs/github-models.md#run-on-azure)
- [Use Hugging Face](./docs/hugging-face.md#run-on-azure)
- [Use Anthropic](./docs/anthropic.md#run-on-azure)
- [Use LG](./docs/lg.md#run-on-azure)
- [Use OpenAI](./docs/openai.md#run-on-azure)

Expand Down
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
- [Azure AI Foundry](azure-ai-foundry.md)
- [GitHub Models](github-models.md)
- [Hugging Face](hugging-face.md)
- [Anthropic](anthropic.md)
- [LG](lg.md)
- [OpenAI](openai.md)
225 changes: 225 additions & 0 deletions docs/anthropic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
# OpenChat Playground with Anthropic

This page describes how to run OpenChat Playground (OCP) with [Anthropic models](https://docs.claude.com/en/docs/about-claude/models) integration.

## Get the repository root

1. Get the repository root.

```bash
# bash/zsh
REPOSITORY_ROOT=$(git rev-parse --show-toplevel)
```

```powershell
# PowerShell
$REPOSITORY_ROOT = git rev-parse --show-toplevel
```

## Run on local machine

1. Make sure you are at the repository root.

```bash
cd $REPOSITORY_ROOT
```

1. Add Anthropic API Key for Claude connection. Make sure you should replace `{{ANTHROPIC_API_KEY}}` with your Anthropic API key.

```bash
# bash/zsh
dotnet user-secrets --project $REPOSITORY_ROOT/src/OpenChat.PlaygroundApp \
set Anthropic:ApiKey "{{ANTHROPIC_API_KEY}}"
```

```bash
# PowerShell
dotnet user-secrets --project $REPOSITORY_ROOT/src/OpenChat.PlaygroundApp `
set Anthropic:ApiKey "{{ANTHROPIC_API_KEY}}"
```

> For more details about Anthropic API keys, refer to the doc, [Anthropic API Documentation](https://docs.anthropic.com/claude/reference/getting-started-with-the-api).

1. Run the app. The default model OCP uses is [Claude Sonnet 4](https://www-cdn.anthropic.com/6be99a52cb68eb70eb9572b4cafad13df32ed995.pdf).

```bash
# bash/zsh
dotnet run --project $REPOSITORY_ROOT/src/OpenChat.PlaygroundApp -- \
--connector-type Anthropic
```

```powershell
# PowerShell
dotnet run --project $REPOSITORY_ROOT/src/OpenChat.PlaygroundApp -- `
--connector-type Anthropic
```

Alternatively, if you want to run with a different model, say [Claude Opus 4.1](http://www.anthropic.com/claude-opus-4-1-system-card), other than the default one, you can specify it as an argument:

```bash
# bash/zsh
dotnet run --project $REPOSITORY_ROOT/src/OpenChat.PlaygroundApp -- \
--connector-type Anthropic \
--model claude-opus-4-1
```

```powershell
# PowerShell
dotnet run --project $REPOSITORY_ROOT/src/OpenChat.PlaygroundApp -- `
--connector-type Anthropic `
--model claude-opus-4-1
```

1. Open your web browser, navigate to `http://localhost:5280`, and enter prompts.

## Run in local container

1. Make sure you are at the repository root.

```bash
cd $REPOSITORY_ROOT
```

1. Build a container.

```bash
docker build -f Dockerfile -t openchat-playground:latest .
```

1. Get Anthropic API Key.

```bash
# bash/zsh
API_KEY=$(dotnet user-secrets --project ./src/OpenChat.PlaygroundApp list --json | \
sed -n '/^\/\//d; p' | jq -r '."Anthropic:ApiKey"')
```

```bash
# PowerShell
$API_KEY = (dotnet user-secrets --project ./src/OpenChat.PlaygroundApp list --json | `
Select-String -NotMatch '^//(BEGIN|END)' | ConvertFrom-Json).'Anthropic:ApiKey'
```

1. Run the app. The default model OCP uses is [Claude Sonnet 4](https://www-cdn.anthropic.com/6be99a52cb68eb70eb9572b4cafad13df32ed995.pdf).

```bash
# bash/zsh - from locally built container
docker run -i --rm -p 8080:8080 openchat-playground:latest --connector-type Anthropic \
--api-key $API_KEY
```

```powershell
# PowerShell - from locally built container
docker run -i --rm -p 8080:8080 openchat-playground:latest --connector-type Anthropic `
--api-key $API_KEY
```

```bash
# bash/zsh - from GitHub Container Registry
docker run -i --rm -p 8080:8080 ghcr.io/aliencube/open-chat-playground/openchat-playground:latest \
--connector-type Anthropic \
--api-key $API_KEY
```

```powershell
# PowerShell - from GitHub Container Registry
docker run -i --rm -p 8080:8080 ghcr.io/aliencube/open-chat-playground/openchat-playground:latest `
--connector-type Anthropic `
--api-key $API_KEY
```

Alternatively, if you want to run with a different model, say [Claude Opus 4.1](http://www.anthropic.com/claude-opus-4-1-system-card), other than the default one, you can specify it as an argument:

```bash
# bash/zsh - from locally built container with custom model
docker run -i --rm -p 8080:8080 openchat-playground:latest --connector-type Anthropic \
--api-key $API_KEY \
--model claude-opus-4-1
```

```powershell
# PowerShell - from locally built container with custom model
docker run -i --rm -p 8080:8080 openchat-playground:latest --connector-type Anthropic `
--api-key $API_KEY `
--model claude-opus-4-1
```

1. Open your web browser, navigate to `http://localhost:8080`, and enter prompts.

## Run on Azure

1. Make sure you are at the repository root.

```bash
cd $REPOSITORY_ROOT
```

1. Login to Azure.

```bash
azd auth login
```

1. Check login status.

```bash
azd auth login --check-status
```

1. Initialize `azd` template.

```bash
azd init
```

> **NOTE**: You will be asked to provide environment name for provisioning.

1. Get Anthropic API Key.

```bash
# bash/zsh
API_KEY=$(dotnet user-secrets --project ./src/OpenChat.PlaygroundApp list --json | \
sed -n '/^\/\//d; p' | jq -r '."Anthropic:ApiKey"')
```

```bash
# PowerShell
$API_KEY = (dotnet user-secrets --project ./src/OpenChat.PlaygroundApp list --json | `
Select-String -NotMatch '^//(BEGIN|END)' | ConvertFrom-Json).'Anthropic:ApiKey'
```

1. Set Anthropic API Key to azd environment variables.

```bash
azd env set ANTHROPIC_API_KEY $API_KEY
```

The default model OCP uses is [Claude Sonnet 4](https://www-cdn.anthropic.com/6be99a52cb68eb70eb9572b4cafad13df32ed995.pdf). If you want to run with a different model, say [Claude Opus 4.1](http://www.anthropic.com/claude-opus-4-1-system-card), other than the default one, add it to azd environment variables.

```bash
azd env set ANTHROPIC_MODEL claude-opus-4-1
```

1. Set the connector type to `Anthropic`.

```bash
azd env set CONNECTOR_TYPE Anthropic
```

1. Run the following commands in order to provision and deploy the app.

```bash
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.

1. Open your web browser, navigate to the OCP app URL, and enter prompts.

1. Clean up all the resources.

```bash
azd down --force --purge
```
5 changes: 5 additions & 0 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ param huggingFaceModel string = ''
// Ollama
param ollamaModel string = ''
// Anthropic
param anthropicModel string = ''
@secure()
param anthropicApiKey string = ''
// LG
param lgModel string = ''
// Naver
Expand Down Expand Up @@ -85,6 +88,8 @@ module resources 'resources.bicep' = {
githubModelsToken: githubModelsToken
huggingFaceModel: huggingFaceModel
ollamaModel: ollamaModel
anthropicModel: anthropicModel
anthropicApiKey: anthropicApiKey
lgModel: lgModel
openAIModel: openAIModel
openAIApiKey: openAIApiKey
Expand Down
6 changes: 6 additions & 0 deletions infra/main.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
"huggingFaceModel": {
"value": "${HUGGING_FACE_MODEL=hf.co/Qwen/Qwen3-0.6B-GGUF}"
},
"anthropicModel" : {
"value": "${ANTHROPIC_MODEL=claude-sonnet-4-0}"
},
"anthropicApiKey" : {
"value": "${ANTHROPIC_API_KEY}"
},
"lgModel": {
"value": "${LG_MODEL=hf.co/LGAI-EXAONE/EXAONE-4.0-1.2B-GGUF}"
},
Expand Down
20 changes: 20 additions & 0 deletions infra/resources.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ param huggingFaceModel string = ''
// Ollama
param ollamaModel string = ''
// Anthropic
param anthropicModel string = ''
@secure()
param anthropicApiKey string = ''
// LG
param lgModel string = ''
// Naver
Expand Down Expand Up @@ -227,6 +230,17 @@ var envOllama = connectorType == 'Ollama' ? concat(ollamaModel != '' ? [
}
] : []) : []
// Anthropic
var envAnthropic = connectorType == 'Anthropic' ? concat(anthropicModel != '' ? [
{
name: 'Anthropic__Model'
value: anthropicModel
}
] : [], anthropicApiKey != '' ? [
{
name: 'Anthropic__ApiKey'
secretRef: 'anthropic-api-key'
}
] : []) : []
// LG
var envLG = connectorType == 'LG' ? concat(lgModel != '' ? [
{
Expand Down Expand Up @@ -268,6 +282,11 @@ module openchatPlaygroundApp 'br/public:avm/res/app/container-app:0.18.1' = {
name: 'github-models-token'
value: githubModelsToken
}
] : [], anthropicApiKey != '' ? [
{
name: 'anthropic-api-key'
value: anthropicApiKey
}
] : [], openAIApiKey != '' ? [
{
name: 'openai-api-key'
Expand Down Expand Up @@ -301,6 +320,7 @@ module openchatPlaygroundApp 'br/public:avm/res/app/container-app:0.18.1' = {
envGitHubModels,
envHuggingFace,
envOllama,
envAnthropic,
envLG,
envOpenAI, useOllama == true ? [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public static async Task<IChatClient> CreateChatClientAsync(AppSettings settings
ConnectorType.AzureAIFoundry => new AzureAIFoundryConnector(settings),
ConnectorType.GitHubModels => new GitHubModelsConnector(settings),
ConnectorType.HuggingFace => new HuggingFaceConnector(settings),
ConnectorType.Anthropic => new AnthropicConnector(settings),
ConnectorType.LG => new LGConnector(settings),
ConnectorType.OpenAI => new OpenAIConnector(settings),
_ => throw new NotSupportedException($"Connector type '{settings.ConnectorType}' is not supported.")
Expand Down
Loading
Loading