Dify 플러그인 제작 1. 준비 및 플러그인 생성
Dify는 기본으로 많은 LLM 제공자나 기능을 지원합니다. 하지만 사내에서 사용하는 모델이나 기능을 Dify에서 지원하지 않는 경우도 있습니다. 예를 들어 Dify는 네이버의 하이퍼클로바X 모델을 지원하지 않습니다(2026년 1월 기준). 그래서 오픈네트웍시스템에서는 직접 모델 제공자 플러그인을 만들어 하이퍼클로바X 모델을 사용하고 있습니다. 플러그인 코드는 GitHub에 공개하고 있습니다. GitHub - open-network-system/dify-hyperclovax-plugin
본 튜토리얼 시리즈를 통해 플러그인을 직접 만드는 방법을 배웁니다. 맥 운영체제 기준으로 작성되었으나 맥, 리눅스, 윈도우 모두에서 따라하실 수 있습니다.
권장 독자
터미널 사용이 익숙한 파이썬 개발자
전체 시리즈의 학습 목표
사용자 환경에 필요한 모델 제공자 플러그인을 직접 만들 수 있다
본 글의 학습 목표
플러그인 개발에 필요한 도구를 설치
빈 모델 제공자 플러그인을 생성
디버그 환경에서 플러그인 실행
다루지 않는 내용
플러그인을 마켓플레이스에 배포
모델 제공자 이외의 플러그인 만들기
1. 준비 및 플러그인 생성
파이썬 설치
위의 문서를 따라 파이썬 3.12 이상 버전을 설치해 줍니다.
Dify CLI 설치
Releases · langgenius/dify-plugin-daemon 에서 Dify 플러그인 제작 CLI 도구를 다운로드합니다.
맥은 Homebrew로 설치할 수 있습니다.
brew tap langgenius/dify
brew install dify설치 후 다음 version 명령어를 실행해봅니다.
dify versionv0.5.3 등의 버전이 표기되면 정상적으로 설치된 것입니다.
플러그인 생성
dify plugin init플러그인 폴더를 생성할 곳에서 위 명령어를 실행합니다.
Edit profile of the plugin
Plugin name (press Enter to next step): 플러그인 이름
Author (press Enter to next step): 플러그인 제작자 이름(회사나 아이디나 성명)
Description (press Enter to next step): 플러그인 설명
Repository URL (Optional) (press Enter to next step): GitHub 등 플러그인 코드 저장소 주소 (선택 사항)
Enable multilingual README: [✔] English is required by default
Languages to generate:
English: [✔] (required)
简体中文 (Simplified Chinese): [✘]
日本語 (Japanese): [✘]
Português (Portuguese - Brazil): [✘]
Controls:
↑/↓ Navigate • Space/Tab Toggle selection • Enter Next step기본 사항을 작성해 줍니다. 저는 ons-test-plugin 라는 이름을 사용했습니다.
Select the language you want to use for plugin development, and press Enter to
BTW, you need Python 3.12+ to develop the Plugin if you choose Python.
-> python
go (not supported yet)go는 현재 지원하지 않습니다. python을 선택합니다.
We've provided templates to help you get started. Choose one of the options below:
tool
agent-strategy
-> llm
text-embedding
rerank
tts
speech2text
moderation
extension
datasource
trigger모델 제공자를 만들어 보겠습니다.
Configure the permissions of the plugin, use up and down to navigate, tab to select, after selection, press enter to finish
Backwards Invocation:
Tools:
Enabled: [✘] You can invoke tools inside Dify if it's enabled
Models:
Enabled: [✔] You can invoke models inside Dify if it's enabled
LLM: [✔] You can invoke LLM models inside Dify if it's enabled
→ Text Embedding: [✘] You can invoke text embedding models inside Dify if it's enabled
Rerank: [✘] You can invoke rerank models inside Dify if it's enabled
TTS: [✘] You can invoke TTS models inside Dify if it's enabled
Speech2Text: [✘] You can invoke speech2text models inside Dify if it's enabled
Moderation: [✘] You can invoke moderation models inside Dify if it's enabled
Apps:
Enabled: [✘] Ability to invoke apps like BasicChat/ChatFlow/Agent/Workflow etc.
Resources:
Storage:
Enabled: [✘] Persistence storage for the plugin
Size: N/A The maximum size of the storage
Endpoints:
Enabled: [✘] Ability to register endpointsTab으로 체크 표시를 변경합니다. LLM만 선택합니다.
Edit minimal Dify version requirement, leave it blank by default
Minimal Dify version (press Enter to next step): 최소 Dify 버전을 선택합니다. 빈 상태(Minimal dify version 이라고 되어 있는 상태)에서 엔터를 누르면 기본값으로 설정됩니다.
모델 제공자 플러그인을 생성했습니다.
2. 디버그 환경에서 플러그인 실행
디버깅 환경 변수 작성
플러그인 폴더로 이동해 .env 파일을 생성하고 환경 변수를 작성합니다.
INSTALL_METHOD=remote
REMOTE_INSTALL_URL=디버깅 URL:포트 번호
REMOTE_INSTALL_KEY=********-****-****-****-************INSTALL_METHOD 는 remote 이고, 다른 정보는 Dify 플러그인 관리 페이지의 디버그 메뉴에서 확인할 수 있습니다.
URL이 localhost 이고, Dify 도커가 있는 컴퓨터에서 디버깅을 할 경우
REMOTE_INSTALL_URL 은 디버깅 정보의 URL을 그대로 사용하세요.
URL이 localhost 이고, Dify 도커가 있는 컴퓨터가 아닌 다른 컴퓨터에서 디버깅을 할 경우
내부 IP로 접근 가능한 경우(회사 컴퓨터 - 회사 서버 등), Dify가 구동중인 사설 IP 주소를 써 줍니다(192.168.0.번호)
내부 IP로 접근할 수 없는 경우, Dify docker-compose.yaml의 plugin-daemon.environment.PLUGIN_REMOTE_INSTALLING_HOST 값을 도메인 호스트 등으로 설정해줍니다.
파일 내용 수정
(이 내용은 추후 Dify 플러그인 CLI 오류가 수정되면 필요없을 수 있습니다)
v0.5.3 기준으로 기본 생성된 Dify LLM 제공자 플러그인에는 오류가 있습니다. 다음을 참고해 provider/{플러그인명}.yaml 파일을 수정합니다.
(생략)
icon_small:
en_US: "icon_s_en.svg" <- 이것을 "icon.svg"로 바꿔줍니다.
icon_large:
en_US: "icon_l_en.svg" <- 이것을 "icon.svg"로 바꿔줍니다.
(생략)
extra:
python:
provider_source: provider/openai.py <- openai를 삭제하고, plugin/에 있는 py 파일명으로 변경해줍니다.
model_sources:
- "models/llm/llm.py"
파이썬 라이브러리 설치, 실행
0.7 미만 최신 버전인 0.6.2에는 OpenAI 호환 API에 버그가 있습니다. [models] Error: MAX_REQUEST_TIMEOUT · Issue #28890 · langgenius/dify
requirements.txt 파일을 열어봅니다.
dify_plugin>=0.4.0,<0.7.0위와 같이 되어 있는 경우, 다음 내용으로 변경합니다.
dify_plugin>0.7다음 명령어를 실행합니다.
pip install -r requirements.txt
python -m main다음과 같은 로그가 나오면 성공입니다. Dify 페이지를 새로고침하면 플러그인이 디버그중인 것을 확인할 수 있습니다.
{"event": "log", "data": {"level": "INFO", "message": "Installed model: ons-test-plugin", "timestamp": 1770177734.573282}}
INFO:dify_plugin.plugin:Installed model: ons-test-plugin다음 튜토리얼에서는 본격적으로 파이썬 코드와 모델 명세를 작성하겠습니다. 수고하셨습니다.
다음 튜토리얼: 2. 모델 제공자 설정
오픈네트웍시스템 변재우