얕고 넓게

[AI] Open-WebUI @ Python Virtual Env 정리 본문

IT/AI.ML

[AI] Open-WebUI @ Python Virtual Env 정리

블랙오닉스 2025. 3. 8. 18:33

2025.03.08

Open-WebUI 환경설정으로 ChatGPT에 물어봐도 대답이 별로다.

llama3:8b 를 통해서 다시 정리해서 물어봤다.

where is configuration file of Open-webui in python environment in windows 11?
=>
%USERPROFILE%\AppData\Roaming\OpenWebUI\config.json

찾아보니 없어서

There is no %USERPROFILE%\AppData\Roaming\OpenWebUI. Open-webui is running in Python virtual env.
=>
path\to\your\virtualenv\Lib\site-packages\openwebui\config.json

그래도 없어서

I found site-packages/open_webui directory. But no config.json. There are many directories such as data, frontend, test, and so on.
=>
Look for other configuration files : Apart from config.json, other configuration files like settings.py or env.py could be present in the same directory or elsewhere in the package.

디렉토리에 env.py 를 확인해보니 .env를 찾는 부분이 있다.

####################################
# Load .env file
####################################

OPEN_WEBUI_DIR = Path(__file__).parent  # the path containing this file
print(OPEN_WEBUI_DIR)

BACKEND_DIR = OPEN_WEBUI_DIR.parent  # the path containing this file
BASE_DIR = BACKEND_DIR.parent  # the path containing the backend/

print(BACKEND_DIR)
print(BASE_DIR)
try:
    from dotenv import find_dotenv, load_dotenv

    load_dotenv(find_dotenv(str(BASE_DIR / ".env")))
except ImportError:
    print("dotenv not installed, skipping...")

BASE_DIR에 .env를 찾는다

 

 open_webui  python .\env.py
C:\Users\black\openwebui_env\Lib\site-packages\open_webui
C:\Users\black\openwebui_env\Lib\site-packages
C:\Users\black\openwebui_env\Lib

이제까지 black, openwebui_env, site-packages, open_webui 까지는 복사했는데 Lib는 안했다.

.env에서 CHUNK_SIZE=222로 해서 복사

Open-WebUI 다시 실행

안된다 ㅠㅠ

INFO  [open_webui.env] 'ENABLE_OPENAI_API' loaded from the latest database entry
INFO  [open_webui.env] 'OPENAI_API_KEYS' loaded from the latest database entry
INFO  [open_webui.env] 'OPENAI_API_BASE_URLS' loaded from the latest database entry
INFO  [open_webui.env] 'OPENAI_API_CONFIGS' loaded from the latest database entry
INFO  [open_webui.env] 'ENABLE_SIGNUP' loaded from the latest database entry
INFO  [open_webui.env] 'DEFAULT_LOCALE' loaded from the latest database entry
INFO  [open_webui.env] 'DEFAULT_PROMPT_SUGGESTIONS' loaded from the latest database entr

 

open_webui.env는 없어서 뒤지다 보니...

C:\Users\black\openwebui_env\Lib\site-packages\open_webui\data\vector_db
chroma.sqlite3

아까 지웠는데 그대로 있다.

*.json을 찾아 본다.

conf*.json, set*.json 없다.

 

환경 변수 같다.

그전에

C:\Users\black\openwebui_env\check_env.py
python check_env.py
PORT: None
OLLAMA_BASE_URL: http://localhost:11434
USE_CUDA: 1
CUDA_VISIBLE_DEVICES: 0
VECTOR_DB_TYPE: chroma
VECTOR_DB_PATH: ./chroma_db
CHUNK_SIZE: 777

결과는 현재 디렉토리의 .env 설정 값이다.

 

'IT > AI.ML' 카테고리의 다른 글

[AI] Open-WebUI + Pipeline  (0) 2025.03.08
[AI] 허깅페이스 모델 다운로드 & 변환  (0) 2025.03.08
[AI] Open-WebUI @Linux  (0) 2025.03.08
[AI] Docker + Open-webui  (0) 2025.03.08
[AI] Ollama + Vector DB  (0) 2025.02.28