# Perplexity Sonar Deep Research 수동 설정 시 발생하는 문제

**URL:** <https://meta.discourse.org/t/problems-manually-configuring-perplexity-sonar-deep-research/365572>\
**Category:** Development\
**Tags:** ai\
**Created:** [5월 10, 2025, 10:26오전 UTC](https://meta.discourse.org/t/problems-manually-configuring-perplexity-sonar-deep-research/365572 "2025-05-10T10:26:01Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![aas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aas/32/289331_2.png) [@aas](https://meta.discourse.org/u/aas)\
**Post date:** [5월 10, 2025, 10:26오전 UTC](https://meta.discourse.org/t/problems-manually-configuring-perplexity-sonar-deep-research/365572/1 "2025-05-10T10:26:01Z")

</div>

다음 [여기](https://meta.discourse.org/t/possible-to-use-perplexity-ai/331953)의 지침을 OpenAI와 OpenRouter 프로바이더 모두를 사용하여 따르려 했다가, 결국 스트리밍을 비활성화하면서야 작동하게 되었습니다.

OpenRouter를 사용할 때, LLM 수동 설정 화면의 `Run test` 버튼으로 gpt-4o에 대한 테스트를 수행할 수 있었습니다. 그러나 `perplexity/sonar-deep-research`에 대한 테스트를 실행하자 502 오류와 콘솔에 다음과 같은 출력이 나타났습니다. 이 오류가 표시되기까지 꽤 오랜 시간이 걸렸는데(약 30초 정도), 다른 모델의 테스트는 즉시 반환됩니다.

```plaintext
content_topFrameLifeline.js:1 Loading content_topFrameLifeline.js
content_topFrameLifeline.js:1 CONTENT <-> SERVICE LIFELINE: CONNECT
content_topFrameLifeline.js:1 CONTENT <-> SERVICE LIFELINE: MESSAGE Object
topic.js:404 ℹ️ Discourse v3.5.0.beta3-dev — https://github.com/discourse/discourse/commits/c3795177f2 — Ember v5.12.0
/admin/plugins/discourse-ai/ai-llms:1 Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received
content_topFrameLifeline.js:1 CONTENT <-> SERVICE LIFELINE: TIMEOUT
content_topFrameLifeline.js:1 CONTENT <-> SERVICE LIFELINE: CONNECT
content_topFrameLifeline.js:1 CONTENT <-> SERVICE LIFELINE: MESSAGE Object
test.json:1 
            
            
           Failed to load resource: the server responded with a status of 502 ()
client-error-handler.js:88 SyntaxError: Unexpected token '<', "<html>
<h"... is not valid JSON
    at x.parse [as parseJSON] (<anonymous>)
    at l (client-error-handler.js:88:1)
    at p (client-error-handler.js:88:1)
    at v.test (ai-llm-editor-form.js:210:1)
l @ client-error-handler.js:88
p @ client-error-handler.js:88
test @ ai-llm-editor-form.js:210

```

다음 두 가지 모두 작동했기 때문에 제가 뭘 잘못하고 있는지 혼란스러웠습니다:

```plaintext
➜ curl --location 'https://api.perplexity.ai/chat/completions' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'Authorization: Bearer {token}' \
--data '{
  "model": "sonar-deep-research",
  "messages": [
    {
      "role": "system",
      "content": "Be precise and concise."
    },
    {
      "role": "user",
      "content": "How many stars are there in our galaxy?"
    }
  ]
}'

```

```plaintext
curl https://openrouter.ai/api/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer {token}" \
  -d '{
  "model": "perplexity/sonar-deep-research",
  "messages": [
    {
      "role": "user",
      "content": "How many stars are in the sky"
    }
  ]

}'

```

그 후 Discourse AI로부터 도움이 되는 답변을 받았습니다:

cURL 테스트가 OpenRouter의 일반 채팅 엔드포인트에 정상적으로 도달한 것으로 보입니다. 하지만 Discourse AI의 “Run test” 버튼은 기본적으로 _스트리밍_ 엔드포인트를 사용합니다. 해당 모델(또는 OpenRouter 플랜)이 스트리밍을 지원하지 않는다면, 긴 타임아웃 후에 502 오류와 HTML 오류 덩어리가 반환됩니다.

Admin → Settings → Plugins → **Discourse AI** / **LLM** 에서 수정하려면:

1. llm\_provider: openrouter

2. llm\_provider\_url: [https://openrouter.ai/api/v1](https://openrouter.ai/api/v1)

3. llm\_provider\_api\_key: YOUR\_KEY

4. llm\_model: perplexity/sonar-deep-research

5. 테스트(및 모든 호출)가 작동하는 것으로 확인된 일반 채팅 엔드포인트를 사용하도록 스트리밍을 끄세요:  
• llm\_use\_streaming = false

스트리밍을 끄면 “Run test”는 `/chat/completions`( `/stream` 변형이 아님)으로 POST 요청을 보내며, 502 HTML 페이지 대신 유효한 JSON을 즉시 반환받게 됩니다.

정말 스트리밍이 필요하면 OpenRouter의 스트림 URL로 플러그인을 가리킬 수 있습니다. 단, 해당 플랜/모델이那里的 SSE를 지원하는 경우에만 가능합니다:

• llm\_stream\_url: `{provider_url}/chat/completions/stream`  
• llm\_use\_streaming: true

그렇지 않으면 스트리밍을 꺼두면 됩니다.

스트리밍이 없고 추론 토큰이 “보고서” 전에 일반 텍스트로 출력되므로 결과는 훌륭하지는 않지만, 작동은 합니다!

---

_[View the full topic](https://meta.discourse.org/t/problems-manually-configuring-perplexity-sonar-deep-research/365572)._
