Skip to content

Conversation

donghyeon639
Copy link
Contributor

Purpose

Does this introduce a breaking change?

[ ] Yes
[x] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] Bugfix
[x] New feature
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

README updated?

The top-level readme for this repo contains a link to each sample in the repo. If you're adding a new sample did you update the readme?

[ ] Yes
[ ] No
[x] N/A

How to Test

  • Get the code
git clone https://github.com/donghyeon639/open-chat-playground.git
cd open-chat-playground
git checkout  feat/269-connector-implementation-inheritance-ollama
  • Test the code
dotnet test test/OpenChat.PlaygroundApp.Tests/OpenChat.PlaygroundApp.Tests.csproj --filter "FullyQualifiedName~Ollama"

What to Check

Verify that the following are valid

  • Whether you inherited LanguageModelConnector
  • inserted AppSettings and overridden GetChatClient
  • Check if the unit tests in OllamaConnectorTests.cs pass
  • Check if the bicep file ollama template is written correctly

Other Information

@tae0y
Copy link
Member

tae0y commented Sep 18, 2025

#455 (comment)
말씀하신 것처럼 Ollama 컨테이너를 따로 올려서 도커 내부끼리 연결하는 방법이 있습니다.
저희 프로젝트에 어떤 방식으로 적용할지는 bicep, 마크다운 단계에서 같이 고민해보시죠!

@tae0y
Copy link
Member

tae0y commented Sep 18, 2025

개요

replacement of #455
리뷰는 다음과 같이 순서대로 진행하겠습니다

  • 커넥터 코드 로직 / 다른 부분을 확인하고, 전체적으로 다시확인
    • model 태그명 유효성 검사
    • baseurl 경계값 테스트 추가
  • bicep
  • 마크다운 문서

백로그

  • 현재 bicep은 외부에서 baseurl을 받는 구조로 되어 있음. 어딘가에 ollama를 로컬에 띄우고 연결하여 통합테스트 가능한 구조. 차후에는 Azure Container Registry, Serverless GPU 등 사용한 구조로 완전히 변경하여야함.
  • 기본값변경: llama3.2는 3b에서도 한국어에 제대로 답변하지 못해서, 기본모델을 gemma/qwen 정도로 바꾸면 좋겠음. 특히나 8GB RAM 정도의 노트북에서 CPU로 가볍게 돌릴 수 있는 모델로.
    • Q : 하늘은 무슨 색이야?
    • A : 하늘은 하늘색이지만,จร래 나무 아래의 빛과 어두운 shade로 변한다.
  • 기능추가: ollama에 pull되지 않은 model을 선택시 명시적인 예외를 던지기
  • 기능개선:모델명으로 불러온 모델은 태그없이 연결가능. 모델명:태그로 불러온 모델은 태그를 꼭 붙여야함. 태그를 지정하지 않은 경우, 해당 모델이 하나뿐이면 연결해주고 두개 이상이면 ambiguous model name으로 CLI에 안내해주기.
  • EnsureLanguageModelSettingsValid 메서드의 경계값 커버리지
  • Ollama 도커파일 추가, 볼륨 설정

커버해야하는 경계값은?

  • 공백 : 예) "", " "
  • null
  • 값 앞뒤로 trailing 공백
    • settings.BaseUrl!.Trim()) 로직이 있음
  • 유효하지 않은 값, 이하 예시
    • baseurl인데 url포맷이 아닌경우
    • modelname인데 ollama 네이밍 컨벤션을 따르지 않는경우
      • latest 모델의 경우 태그 생략가능, 태그를 꼭 써야하는 경우는 문서에 기재

Copy link
Member

@tae0y tae0y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다! 먼저 로컬 머신에서 기동하는 부분을 테스트했습니다.
확인해보니 몇가지 상의할 부분이 있었습니다.

첫째로 Model의 경우 Ollama의 네이밍 컨벤션을 고려해 유효성 검사 로직이 필요할까요?
제 생각에는 차후에 문서에 잘 반영해두면 될 것 같은데 어떠실까요?

둘째로 테스트에서 커버할 경계값을 더 추가하면 좋겠습니다.
현재는 공백, null에 대해서 다루고 있습니다.
Model의 경우에는 위에서 유효성 검사 로직 추가여부에 따라 달라질 것 같고,
Uri를 잘못된 형식으로 전달한 경우도 테스트해도 좋을 것 같습니다.

그외에 테스트 컨벤션을 잘 반영해주셨습니다. 😎😎

@donghyeon639
Copy link
Contributor Author

커버해야하는 경계값은?

  • 공백 : 예) "", " "

  • null

  • 값 앞뒤로 trailing 공백

  • 유효하지 않은 값, 이하 예시

    • baseurl인데 url포맷이 아닌경우
    • modelname인데 ollama 네이밍 컨벤션을 따르지 않는경우

값 앞뒤로 trailing 공백에 대한 부분은 settings.BaseUrl!.Trim()) == true 부분에서 공백이 없어지기에 추가하지 않는다고 판단해서 추가하지 않았습니다 baseurl에 url 포맷이 아닌경우에 대한 경계값은 EnsureLanguageModelSettingsValid 메서드는 단순히string.IsNullOrWhiteSpace만 체크하기에 GetChatClientAsync에서 경우에만 추가하였습니다!

@tae0y
Copy link
Member

tae0y commented Sep 19, 2025

로컬 컨테이너 배포시

  • 호스트 머신의 Ollama를 사용한다면 현재와 같이 http://host.docker.internal:11434 사용
    • 이 경우 호스트 머신 Ollama가 도커쪽 요청을 들을 수 있도록 환경변수 설정 필요
    • 맥/리눅스 export OLLAMA_HOST=0.0.0.0, 윈도우 그.. 고급 시스템설정
  • Ollama 컨테이너는 컨테이너 이름을 사용하여 http://ollama:11434와 같이 사용
    • 이 경우 호스트 머신쪽 설정 불필요
    • Ollama용 도커파일을 추가하고, 두개 컨테이너를 한번에 올릴 수 있도록 문서화 필요
    • Ollama 모델파일을 불필요하게 매번 불러오지 않도록 볼륨 처리 필요하겠음

    Connector 구현 이슈 범위는 아니므로, 별도 이슈를 등록하여 개선건으로 진행

👉 그래서 해야할 일은

  • 호스트 머신 Ollama가 도커쪽 요청을 들을 수 있도록 환경변수 설정 가이드 추가
  • Ollama 도커파일 추가하기

Azure 클라우드 배포시 위 작업 완료후 진행

  • Azure에 Ollama를 어떻게 프로비저닝할지 검토

👉 하지만 일단은

  • Azure 배포 디버깅하기
ERROR: error executing step command 'provision': deployment failed: error deploying infrastructure: deploying to subscription: 

Deployment Error Details:
InvalidTemplateDeployment: The template deployment 'openchatPlaygroundapp' is not valid according to the validation procedure. The tracking id is '8dd4174a-fdda-4e6b-9c8b-005b1b96edb2'. See inner errors for details.
ValidationForResourceFailed: Validation failed for a resource. Check 'Error.Details[0]' for more information.
ContainerAppSecretInvalid: Invalid Request: Container app secret(s) with name(s) 'github-models-token' are invalid: value or keyVaultUrl and identity should be provided.

Copy link
Member

@tae0y tae0y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

테스트코드 잘 확인했습니다!
다른 부분을 본 다음 돌아와서 다시 전체적으로 확인해보시죠.

그전에 호스트 머신의 Ollama를 사용하기 위한 설정방법을 문서에 추가하고,
Azure 배포시 발생하는 오류를 해결해야합니다.
저도 방법을 찾아보고 코멘트 등으로 공유드리겠습니다.

@donghyeon639
Copy link
Contributor Author

로컬 컨테이너 배포시

  • 호스트 머신의 Ollama를 사용한다면 현재와 같이 http://host.docker.internal:11434 사용

    • 이 경우 호스트 머신 Ollama가 도커쪽 요청을 들을 수 있도록 환경변수 설정 필요
    • 맥/리눅스 export OLLAMA_HOST=0.0.0.0, 윈도우 그.. 고급 시스템설정
  • Ollama 컨테이너는 컨테이너 이름을 사용하여 http://ollama:11434와 같이 사용

    • 이 경우 호스트 머신쪽 설정 불필요
    • Ollama용 도커파일을 추가하고, 두개 컨테이너를 한번에 올릴 수 있도록 문서화 필요
    • Ollama 모델파일을 불필요하게 매번 불러오지 않도록 볼륨 처리 필요하겠음

    Connector 구현 이슈 범위는 아니므로, 별도 이슈를 등록하여 개선건으로 진행

👉 그래서 해야할 일은

  • 호스트 머신 Ollama가 도커쪽 요청을 들을 수 있도록 환경변수 설정 가이드 추가
  • Ollama 도커파일 추가하기

Azure 클라우드 배포시 위 작업 완료후 진행

  • Azure에 Ollama를 어떻게 프로비저닝할지 검토

👉 하지만 일단은

  • Azure 배포 디버깅하기
ERROR: error executing step command 'provision': deployment failed: error deploying infrastructure: deploying to subscription: 

Deployment Error Details:
InvalidTemplateDeployment: The template deployment 'openchatPlaygroundapp' is not valid according to the validation procedure. The tracking id is '8dd4174a-fdda-4e6b-9c8b-005b1b96edb2'. See inner errors for details.
ValidationForResourceFailed: Validation failed for a resource. Check 'Error.Details[0]' for more information.
ContainerAppSecretInvalid: Invalid Request: Container app secret(s) with name(s) 'github-models-token' are invalid: value or keyVaultUrl and identity should be provided.

말씀하신 내용 확인했습니다! 정리하자면

  1. Ollama를 별도 컨테이너로 배포

필요한 과정:
Ollama용 Dockerfile 추가: Ollama 서비스를 실행할 수 있는 전용 Dockerfile을 프로젝트에 추가.

컨테이너 동시 실행 설정: 애플리케이션 컨테이너와 Ollama 컨테이너를 한 번에 실행하고 관리할 수 있도록 docker-compose.yml 같은 파일을 작성

모델 데이터 유지를 위한 볼륨 설정: Ollama가 모델 파일을 매번 새로 내려받지 않도록, 컨테이너 외부의 특정 경로와 컨테이너 내부의 모델 저장 경로를 볼륨으로 연결

컨테이너 간 통신 설정: 애플리케이션에서는 http://ollama:11434와 같이 컨테이너 이름을 사용해 Ollama 서비스에 접근하도록 설정
결론적으로 이 과정을 말씀하신게 맞을까요?

@tae0y
Copy link
Member

tae0y commented Sep 22, 2025

결론적으로 이 과정을 말씀하신게 맞을까요?

네 맞습니다~
Azure Container Apps로 배포하려고 하다보니 그런건데,
Azure에 어떻게 배포하면 좋을지 검토해서 공유해주실래요?

제 의견은 컨테이너화하고, Container Apps로 배포, 이후 서버리스 GPU를 사용하는 것입니다.
이렇게 하면 Azure Virtual Machine을 사용했을 때보다 비용이 보다 저렴하고,
꼭 Azure가 아니더라도 다른 클라우드 플랫폼, OnPrem 환경에서 사용하기에도 좋을 것 같습니다.

@donghyeon639
Copy link
Contributor Author

제가 알고 있는 토대로 host.docker.internal:11434 방식으로 문서 추가했습니다. ollama 쪽 환경변수로 함은 $env:OLLAMA_HOST = "0.0.0.0:11434" 쪽을 말하시는것 같아서 이 부분 추가했는데 다른 부분일까요?

@tae0y
Copy link
Member

tae0y commented Sep 23, 2025

제가 알고 있는 토대로 host.docker.internal:11434 방식으로 문서 추가했습니다. ollama 쪽 환경변수로 함은 $env:OLLAMA_HOST = "0.0.0.0:11434" 쪽을 말하시는것 같아서 이 부분 추가했는데 다른 부분일까요?

네 이부분 말씀드린게 맞습니다. 현재 단계에서는 Ollama는 Azure 배포를 하지 않는데,
지금 추가하신 Bicep 구문을 원복할지.. placeholder로 남겨놓을지 좀더 고민해보겠습니다.

Copy link
Member

@tae0y tae0y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

다음 두가지 반영해주셔요!

1) bicep으로 배포시 오류나는 것 확인하고 수정방법 제안.

우리는 ollama를 사용하는데, 아래 구문에서 github models 관련 값이 null이어서 오류발생함! 값 유무를 보고 분기 처리해야할 것 같음.
https://github.com/aliencube/open-chat-playground/pull/456/files#diff-e800ed75064b740be458a572b91420b94ca6743a609c7318facf638f60c7028bL141

OpenAI쪽 이슈에서는 이렇게 처리했군요!
https://github.com/aliencube/open-chat-playground/pull/429/files#diff-e800ed75064b740be458a572b91420b94ca6743a609c7318facf638f60c7028bR150

2) Ollama baseurl도 처리

나중에 ollama를 Azure에서 구동할 예정이라서, 문서에 https://{{OLLAMA_PLACEHOLDER}}:11434 이런 느낌으로 연결 URL 넘겨주는 방법도 포함하고, bicep에도 해당 변수를 처리할 수 있도록 수정해주셔요.

@tae0y
Copy link
Member

tae0y commented Sep 26, 2025

리뷰 준비되면 댓글로 변경사항 간략히 알려주세요

전체적으로 잘 동작하는지 확인되면,
다시 코드단으로 돌아가 컨벤션을 맞추는 작업을 진행합니다 !

@donghyeon639
Copy link
Contributor Author

리뷰 준비되면 댓글로 변경사항 간략히 알려주세요

전체적으로 잘 동작하는지 확인되면, 다시 코드단으로 돌아가 컨벤션을 맞추는 작업을 진행합니다 !

  1. Ollama 사용 시 GitHub Models 관련 배포 오류 해결하였습니다
    조건부로 githubModelsToken 값이 있을 때만 env에 secretRef가 추가 되게끔하는 방식을 사용했습니다.

  2. URL 넘겨주는 방법도 포함하고, bicep에도 해당 변수를 처리할 수 있도록 수정하였습니다

@donghyeon639
Copy link
Contributor Author

bicep 배포쪽은 main을 머지하고서 다시 해보면 될거같아요 혹시나 이 브랜치에 반영안된게 있을 수 있어서

.azure 폴더 삭제후 재시도하니 잘 진행됩니다 ~ 배포 안되는건 그냥 제 로컬 문제네욥

conflict 해결해서 push 했습니다!

@tae0y
Copy link
Member

tae0y commented Sep 29, 2025

@donghyeon639 아직 conflict가 남아있어서 한번더 확인해주셔욥

@donghyeon639
Copy link
Contributor Author

@tae0y 올리신 리뷰사항들보고 수정했습니다!
공백 테스트 케이스로 \n\r 개행문자 혹은 \t 탭 이 부분에 관해서는 model 부분에 있어서 큰 의미가 없다고 생각하여 모델부분은 추가하지 않았습니다

@tae0y
Copy link
Member

tae0y commented Sep 29, 2025

@tae0y 올리신 리뷰사항들보고 수정했습니다! 공백 테스트 케이스로 \n\r 개행문자 혹은 \t 탭 이 부분에 관해서는 model 부분에 있어서 큰 의미가 없다고 생각하여 모델부분은 추가하지 않았습니다

넵 이제 코드 스타일과
Github container registry쪽 추가하고서 정리하면 될것 같아요.

@donghyeon639
Copy link
Contributor Author

@tae0y 올리신 리뷰사항들보고 수정했습니다! 공백 테스트 케이스로 \n\r 개행문자 혹은 \t 탭 이 부분에 관해서는 model 부분에 있어서 큰 의미가 없다고 생각하여 모델부분은 추가하지 않았습니다

넵 이제 코드 스타일과 Github container registry쪽 추가하고서 정리하면 될것 같아요.

말씀하신 사항 수정했습니다!

# bash/zsh
export OLLAMA_HOST=0.0.0.0:11434
ollama serve
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이번에 집 PC를 포맷하는 김에 클린한 환경에서 우리 프로젝트를 돌려봤습니다!
Ollama 앱이 업데이트 되며 아래 표시한 옵션을 활성화해야 외부 접근이 가능해졌습니다.
이 부분도 ollama.md 문서에 포함 부탁해요.

Image

@tae0y
Copy link
Member

tae0y commented Oct 3, 2025

Azure에 배포한 Playground에서 홈서버에 띄운 Ollama를 연결해 테스트해보았습니다.
전체적으로 앱이 잘 동작합니다!

image

@tae0y
Copy link
Member

tae0y commented Oct 3, 2025

@justinyoo 저스틴님! Ollama Connector가 거의 다 마무리 되었습니다.
Bicep은 고민을 하다가 placeholder 용으로 OLLAMA_BASE_URL을 밖에서 주입받게끔 구성했습니다.
그리고 홈서버에 띄운 Ollama를 연결해 잘 동작하는지 테스트 했고, 잘 동작했습니다.

이번 PR은 이렇게 마무리하고,
차후에 Ollama 컨테이너를 Azure에 띄울 때 OLLAMA_BASE_URL 관련 로직을 삭제하고자 합니다.
어떠실까요?

Copy link
Contributor

@justinyoo justinyoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@donghyeon639 @tae0y 우선 이정도로 문서 관련 리뷰 코멘트 남겨뒀습니다. 찬찬히 읽어보시고 다른 문서들과 일관성을 맞춰주세요.

ollama pull llama3.2
# Verify Ollama is accessible
curl http://localhost:11434/api/version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curl 명령어는 파워셸(윈도우OS)에서는 동작하지 않습니다. 따라서, 파워셸용 Invoke-RestMethod 커맨드로도 돌아갈 수 있게 해야 합니다.

다른 문서 보시면 이런 경우 # bash/zsh# PowerShell을 구분지어 놓은 것을 볼 수 있을 겁니다.

docs/ollama.md Outdated
Comment on lines 66 to 77
```powershell
# PowerShell (Windows)
$env:OLLAMA_HOST = "0.0.0.0:11434"
# Start Ollama service
ollama serve
```

```bash
# bash/zsh
export OLLAMA_HOST=0.0.0.0:11434
ollama serve
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

순서는 # bash/zsh 다음에 # PowerShell로 다른 문서와 일관성을 맞춰주세요.

docs/ollama.md Outdated
--model qwen
```
> **NOTE**: Use `host.docker.internal:11434` to connect to Ollama running on the host machine from inside the container. Make sure `OLLAMA_HOST=0.0.0.0:11434` is set on the host.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 OLLAMA_HOST=0.0.0.0:11434 꼭 호스트 머신에서 해 줘야 하나요? 안하면 어떻게 되나요? 허깅페이스 돌릴 땐 이런 얘기가 없었던 것 같은데?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

설정하지 않으면 외부 앱에서 Ollama에 접근하지 못합니다.

Ollama의 고질적인 문제인데, 앱 자체가 127.0.0.1 위에 떠있어서 다른 네트워크 위의 요청을 듣지 못해서요.
공식 문서에서도 운영체제별로 0.0.0.0 위에 서빙해서 네트워크 이슈를 해결하라고 가이드할 정도입니다.
https://docs.ollama.com/faq#how-do-i-configure-ollama-server%3F

최근에는 앱이 업데이트되며 GUI 설정 메뉴에서 expose ollama to the network도 활성화해줘야해요.

이런 네트워크 연결 이슈 해결방법 자체는 Ollama쪽에서도 계속해서 업데이트가 될것 같으니,
저희 문서에서는 제외하고 Ollama 공식 문서를 참고하라 정도만 남겨도 좋겠네요.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그렇다면, 저 OLLAMA_HOST=0.0.0.0:11434 관련 내용 및 Ollama UI 설정 관련해서는 우리 문서에서는 그쪽으로 링크를 걸어주는 게 낫겠네요. 우리는 host.docker.internal:11434 이 정도만 언급해도 충분할 듯.

@name-of-okja 혹시 허깅페이스 설정할 때 이 내용도 함께 설정하셨나요?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@justinyoo

별도로 OLLAMA_HOST 설정을 하지 않았습니다!

(ollama는 wsl에 설치하였습니다.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

추가로
widnwos에 ollama를 설치하고 별도로 OLLAMA_HOST 설정을 안하고 실행시에도 문제 없이 동작 했습니다..!

Comment on lines 136 to 147
ollamaModel != '' ? [
{
name: 'Ollama__Model'
value: ollamaModel
}
] : [],
ollamaBaseUrl != '' ? [
{
name: 'Ollama__BaseUrl'
value: ollamaBaseUrl
}
] : []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

별거 아니긴 한데, 보통 우리가 base URL 다음 model을 가져가는 순서를 쓰니까 그 순서를 맞춰볼까요?

Comment on lines 23 to 28
"ollamaModel": {
"value": "${OLLAMA_MODEL}"
},
"ollamaBaseUrl": {
"value": "${OLLAMA_BASE_URL}"
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기도 마찬가지

Comment on lines 48 to 50
```bash
dotnet run --project $REPOSITORY_ROOT/src/OpenChat.PlaygroundApp -- --connector-type Ollama --model llama3.2
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

다른 문서 - docs/github-models.md, docs/hugging-face.md, docs/openai.md 파일과 같이 일관성을 맞춰 주세요.

Comment on lines 97 to 110
```bash
# bash/zsh - from locally built container
docker run -i --rm -p 8080:8080 \
openchat-playground:latest \
--connector-type Ollama \
--base-url http://host.docker.internal:11434 \
```

```powershell
# PowerShell - from locally built container
docker run -i --rm -p 8080:8080 openchat-playground:latest `
--connector-type Ollama `
--base-url http://host.docker.internal:11434
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bash/zsh 커맨드와 파워셸 커맨드가 뭔가 일관성이 맞지 않죠? 파워셸처럼 맞춰보세요.

Comment on lines 131 to 146
```bash
# bash/zsh - from locally built container
docker run -i --rm -p 8080:8080 \
openchat-playground:latest \
--connector-type Ollama \
--base-url http://host.docker.internal:11434 \
--model qwen
```

```powershell
# PowerShell - from locally built container (with a different model)
docker run -i --rm -p 8080:8080 openchat-playground:latest `
--connector-type Ollama `
--base-url http://host.docker.internal:11434 `
--model qwen
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기도 마찬가지

docs/ollama.md Outdated
Comment on lines 34 to 44
1. Pull the model you want to use. Replace `{{MODEL_NAME}}` with your desired model.

```bash
# Example: Pull llama3.2 model
ollama pull llama3.2
# Or pull other models
ollama pull mistral
ollama pull phi3
ollama pull qwen
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기 어디에도 {{MODEL_NAME}}은 없습니다.

docs/ollama.md Outdated
1. Configure Ollama to accept connections from containers.

```powershell
# PowerShell (Windows)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

파워셸은 윈도우 환경이 아니어도 돌아갑니다. 따라서 (Windows)는 불필요합니다.

@justinyoo
Copy link
Contributor

@justinyoo 저스틴님! Ollama Connector가 거의 다 마무리 되었습니다. Bicep은 고민을 하다가 placeholder 용으로 OLLAMA_BASE_URL을 밖에서 주입받게끔 구성했습니다. 그리고 홈서버에 띄운 Ollama를 연결해 잘 동작하는지 테스트 했고, 잘 동작했습니다.

이번 PR은 이렇게 마무리하고, 차후에 Ollama 컨테이너를 Azure에 띄울 때 OLLAMA_BASE_URL 관련 로직을 삭제하고자 합니다. 어떠실까요?

서버리스 GPU를 써서 Ollama 서버를 운영해야 하는데, 이렇게 하면 사용할 수 있는 지역이 세 개로 확 줄어요. 그래서 이걸 넣는 게 좋을까 고민중... 관련 문서

@justinyoo justinyoo mentioned this pull request Oct 5, 2025
};

var chatClient = new OllamaApiClient(config);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요 사이에 요걸 넣어줘야 나중에 자동으로 모델을 pull 땡겨옵니다.

var pulls = chatClient.PullModelAsync(model);
await foreach (var pull in pulls)
{
Console.WriteLine($"Pull status: {pull!.Status}");
}
Console.WriteLine($"The {this._appSettings.ConnectorType} connector created with model: {settings.Model}");

"value": "${HUGGING_FACE_MODEL}"
},
"ollamaModel": {
"value": "${OLLAMA_MODEL}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"value": "${OLLAMA_MODEL=llama3.2}" 라고 해 줘야 나중에 azd up 실행시킬 때 기본값으로 지정한 모델이 올라갑니다.

@justinyoo
Copy link
Contributor

#491 PR 머지되면서 컨플릭 생겼습니다. 함께 해결해 주세요.

@donghyeon639
Copy link
Contributor Author

@tae0y 올라마 커넥터 수정하면서 테스트 파일에 오류가 생겨서 원인 파악한 후 다시 푸쉬하겠습니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Connector Implementation & Inheritance: Ollama

4 participants