본문 바로가기
AI/AI Eco System

Open WebUI - 기본

by 조병희 2025. 3. 19.

Open WebUI is an extensible, feature-rich, and user-friendly self-hosted AI platform designed to operate entirely offline. It supports various LLM runners like Ollama and OpenAI-compatible APIs, with built-in inference engine for RAG, making it a powerful AI deployment solution.

설치

https://docs.openwebui.com

 

🏡 Home | Open WebUI

Open WebUI is an extensible, feature-rich, and user-friendly self-hosted AI platform designed to operate entirely offline. It supports various LLM runners like Ollama and OpenAI-compatible APIs, with built-in inference engine for RAG, making it a powerful

docs.openwebui.com

github 연결하여 직접 설치하거나 docker로 설치

 

설정(Ollama 연결)

월 비용 내지 않고 정말 필요한 경우에만 쓰기 위해 OpenAI API를 사용할 경우도 있겠지만 대부분은 Ollama나 LM Studio를 확장해서 쓰기 위해 설치할 것으로 예상된다.

좌측 하단 이름 > 설정 > 관리자 > 연결 

- Ollama API 활성화

- 주소 입력

보통은 http://localhost:11434 를 넣으면 될 듯하고, 전 Open WebUI를 도커로 설치한터라 host.docker.internal 로 설정했다.

만약 LM Studio 같은 것을 사용한다면 Direct Connections 활성화하고 

좌측 하단 이름 > 설정 > 연결 > 추가 가능하다. 

여기까지만 해도 기본적인 사용은 가능하다. 

 

이후로 구체적으로 살펴 본다.

 

HTTPs 연결 ( https://docs.openwebui.com/getting-started/advanced-topics/https-encryption )

아래 중 적절한 선택

  • AWS 환경: AWS Elastic Load Balancer를 활용하는 것은 HTTPS를 관리하는 실용적인 선택입니다.
  • Docker 컨테이너 환경: 대표적인 솔루션으로 Nginx, Traefik, Caddy 등이 있습니다.
  • Cloudflare: 최소한의 서버 구성만으로 쉽게 HTTPS를 설정할 수 있어 다양한 애플리케이션에 적합합니다.
  • Ngrok: 로컬 개발 환경에서 빠르게 HTTPS를 설정할 수 있는 방법을 제공하며, 테스트 및 데모에 특히 유용합니다.

 

모니터링( https://docs.openwebui.com/getting-started/advanced-topics/monitoring )

1. 기본적으로 /health를 제공한다.

curl http://localhost:8080/health
{"status":true}%

2. Uptime Kuma 사용하기

https://github.com/louislam/uptime-kuma

Uptime Kuma는 훌륭하고 사용하기 쉬운 오픈 소스 자체 호스팅 가동 시간 모니터링 도구입니다.

  1. Uptime Kuma 대시보드에서 "새 모니터 추가"를 클릭하세요.
  2. 다음 구성을 설정합니다.
    • 모니터 유형: HTTP(들)
    • 이름: 오픈 웹UI
    • URL:http://your-open-webuiinstance:8080/health
    • 모니터링 간격: 60초(또는 선호하는 간격)
    • 재시도 횟수: 3(권장)

상태 확인은 다음을 확인합니다.

  • 웹 서버가 응답하고 있습니다
  • 응용 프로그램이 실행 중입니다
  • 기본 데이터베이스 연결

 

환경 변수 설정 (https://docs.openwebui.com/getting-started/env-configuration)

backend/open_webui/config.py Open WebUI 시작 구성을 제공하는 데 사용됩니다. 일부 변수는 Open WebUI를 직접 실행하는지 아니면 Docker를 통해 실행하는지에 따라 기본값이 다를 수 있습니다.

그외 보안 관련, RAG, 웹검색, 인증, 권한 등이 있다. 

상당 부분은 설정에서도 변경 가능하다.

 

업데이트 ( https://docs.openwebui.com/getting-started/updating )

데이터는 open-webui docker volumn에 저장됨으로 이미지를 삭제하고 새로 올린다.

1. 도커를 사용하여 구성한 경우 기존 이미지를 삭제하고 다시 받아서 올리면 된다.

docker rm -f open-webui
docker pull ghcr.io/open-webui/open-webui:main

2. 별도의 컨테이너로 Watchtower 실행

Watchtower는 실행 중인 Docker 컨테이너의 이미지를 자동으로 업데이트하고 재시작하는 도구입니다.

https://github.com/containrrr/watchtower

 

GitHub - containrrr/watchtower: A process for automating Docker container base image updates.

A process for automating Docker container base image updates. - GitHub - containrrr/watchtower: A process for automating Docker container base image updates.

github.com

docker run -d --name watchtower \
  --volume /var/run/docker.sock:/var/run/docker.sock \
  containrrr/watchtower -i 300 open-webui

 

3. 도커 컴포즈 내에 하나로 합치기

version: '3'
services:
  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    ports:
      - "3000:8080"
    volumes:
      - open-webui:/app/backend/data

  watchtower:
    image: containrrr/watchtower
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    command: --interval 300 open-webui
    depends_on:
      - open-webui

volumes:
  open-webui:

In this example, Watchtower is integrated with the docker-compose.yml file and watches the Open WebUI container for updates every 5 minutes.

 

API End point

기본적으로 web ui로 제공하지만 몇가지 API도 제공한다.

API에 대한 안전한 액세스를 보장하려면 인증이 필요합니다. Bearer Token 메커니즘을 사용하여 API 요청을 인증할 수 있습니다. Open WebUI의 설정 > 계정에서 API 키를 얻거나 인증을 위해 JWT(JSON 웹 토큰)를 사용하십시오.

curl -X POST http://localhost:3210/api/chat/completions \
-H "Authorization: Bearer 1234qwerasdfxcv" \
-H "Content-Type: application/json" \
-d '{
      "model": "gemma3:4b",
      "messages": [
        {
          "role": "user",
          "content": "Why is the sky blue?"
        }
      ]
    }'
{"id":"gemma3:4b-5dff3d79-e22b-4b9f-a516-fcf9a041a1d6","created":1742368425,"model":"gemma3:4b","choices":[{"index":0,"logprobs":null,"finish_reason":"stop","message":{"content":"The blue color of the sky is a fascinating phenomenon caused by a process called **Rayleigh scattering**. Here's a breakdown of how it works:\n\n**1. Sunlight and its Colors:**\n\n* Sunlight appears white, but it's actually made up of all the colors of the rainbow – red, orange, yellow, green, blue, indigo, and violet.  Think of a prism splitting white light.\n\n**2. Entering the Atmosphere:**\n\n* When sunlight enters the Earth's atmosphere, it collides with tiny air molecules (mostly nitrogen and oxygen).\n\n**3. Rayleigh Scattering:**\n\n* **This is the key!** Rayleigh scattering describes how light is scattered by particles that are *much smaller* than the wavelength of the light.\n* **Shorter wavelengths scatter more:** Blue and violet light have shorter wavelengths than other colors. Because of this, they are scattered *much* more strongly by the air molecules.  It's like throwing a small ball (blue light) against a bumpy surface – it bounces off in all directions.  A larger ball (red light) would be less affected.\n\n**4. Why Blue, Not Violet?**\n\n* Violet light is actually scattered *even more* than blue light. However, there are a couple of reasons we see a blue sky instead of violet:\n    * **Sunlight emits less violet light:** The sun emits less violet light to begin with.\n    * **Our eyes are more sensitive to blue:** Our eyes are more sensitive to blue light than violet light.\n\n\n**In simpler terms:**\n\nImagine the air molecules as tiny obstacles. Blue light gets bounced around more than other colors, so it spreads out across the sky.  That's why we see blue!\n\n**What about sunsets?**\n\nAt sunset and sunrise, the sunlight has to travel through *much* more of the atmosphere to reach our eyes.  This longer path means that most of the blue light has already been scattered away.  The longer wavelengths – red and orange – are less scattered and can make it through, giving us those beautiful sunset colors.\n\n\n\n**Resources for further learning:**\n\n* **NASA - Why is the sky blue?:** [https://science.nasa.gov/sky-science/why-is-the-sky-blue/](https://science.nasa.gov/sky-science/why-is-the-sky-blue/)\n* **Wikipedia - Rayleigh scattering:** [https://en.wikipedia.org/wiki/Rayleigh_scattering](https://en.wikipedia.org/wiki/Rayleigh_scattering)\n\n\nDo you want me to delve into any specific aspect of this explanation, such as:\n\n*   The physics behind Rayleigh scattering in more detail?\n*   How this affects other celestial phenomena?","role":"assistant"}}],"object":"chat.completion","usage":{"response_token/s":45.03,"prompt_token/s":40.0,"total_duration":14139467708,"load_duration":927755125,"prompt_eval_count":15,"prompt_tokens":15,"prompt_eval_duration":375000000,"eval_count":578,"completion_tokens":578,"eval_duration":12835000000,"approximate_total":"0h0m14s","total_tokens":593,"completion_tokens_details":{"reasoning_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}}}%

 

웹 검색

이름 > 설정 > 관리자 > 웹 검색

로컬에 무료로 설치가능한 SearxNG가 있으나 검색 결과도 시원찮고 설치도 쉽지 않다. 아래는 그나마 쉽게 느껴진 웹 검색.

https://serper.dev

 

Serper - The World's Fastest and Cheapest Google Search API

 

serper.dev

- 3500번까지 무료 검색

https://serpapi.com

 

SerpApi: Google Search API

SerpApi is a real-time API to access Google search results. We handle proxies, solve captchas, and parse all rich structured data for you.

serpapi.com

- 월 100번까지 무료 검색

https://tavily.com

 

Tavily

Tavily is a search engine tailored for AI agents, delivering real-time, accurate results, intelligent query suggestions, and in-depth research capabilities.

tavily.com

- 월 1,000번까지 무료 검색

 

 

댓글