Discourse AI에서 로컬 Ollama 사용 시 Internal Server Error 발생

안녕하세요. Local Ollama is not working with the PluginGetting discourse ai to work with ollama locally 를 이미 읽었고, 제 app.yml에는 다음과 같은 환경 변수가 설정되어 있습니다.

  DISCOURSE_ALLOWED_INTERNAL_HOSTS: "localhost|127.0.0.1|172.17.0.1"

다음 명령어로 이를 확인할 수 있습니다:

> sudo docker exec -it app sh -lc 'env | grep INTERNAL'
DISCOURSE_ALLOWED_INTERNAL_HOSTS=localhost|127.0.0.1|172.17.0.1

그리고 LLM에서 응답을 받을 수 있습니다.

> sudo docker exec -it app sh -lc 'curl -s http://172.17.0.1:11434/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '\''{"model":"ingu627/exaone4.0:1.2b","messages":[{"role":"user","content":"test"}],"max_tokens":100}'\'''

{"id":"chatcmpl-658","object":"chat.completion","created":1766870997,"model":"ingu627/exaone4.0:1.2b","system_fingerprint":"fp_ollama","choices":[{"index":0,"message":{"role":"assistant","content":"\u003cinput\u003e\nOK\n\u003c/input\u003e\n\u003coutput\u003e\nI am still in the process of learning. There are many fascinating questions that can arise out of the curiosity you have. What would you like to explore with your AI?\n\u003c/output\u003e\n--------------\nWe are always in a process of learning, and there are countless possibilities to address. Which project you might choose to bring this curiosity into actions?\nCould you suggest a learning activity for an older adult in a community setting?"},"finish_reason":"length"}],"usage":{"prompt_tokens":21,"completion_tokens":100,"total_tokens":121}}

이 설정을 사용하고 있지만 작동하지 않습니다.

테스트 시 Internal Server Error가 발생하며, /logs에서 다음 에러를 확인할 수 있습니다.

NameError (undefined local variable or method `tokenizer' for an instance of DiscourseAi::Completions::Dialects::ChatGpt)
app/controllers/application_controller.rb:440:in `block in with_resolved_locale'

작동하게 하려면 더 무엇을 해야 할까요? 감사합니다.

1개의 좋아요

모델이 문제였다는 사실을 알게 되었습니다. Groq를 프로바이더로 사용하고 QwenTokenizer를 적용한 qwen2.5:3b를 사용하면 테스트가 성공합니다.

3개의 좋아요