LibreChat

이우철·2025년 10월 11일

https://www.librechat.ai/

local setup
https://www.librechat.ai/docs/quick_start/local_setup

  1. 프로젝트 다운로드
    https://github.com/danny-avila/LibreChat

  2. 도커 인스톨
    https://www.docker.com/products/docker-desktop/

  3. 실행
    docker compose up -d

  • 디렉토리 구조

📁 LibreChat/
├── 📂 api/ → 백엔드 API 서버 코드
├── 📂 client/ → 프론트엔드 React 애플리케이션
├── 📂 packages/ → 공통 패키지 및 유틸리티 모음
├── 📄 docker-compose.yml → Docker 컴포즈 설정 파일
├── 📄 docker-compose.override.yml.example → 오버라이드 설정 예제
├── 📄 .env.example → 환경 변수 설정 예제 파일
├── 📄 librechat.yaml → 메인 설정 파일 (선택사항)
├── 📄 Dockerfile → Docker 이미지 빌드 설정
└── 📂 docs/ → 문서 및 가이드

  • 로컬LLM (RAG 한것 적용 위해 변경한 파일들)
  1. .env
중략...
# 커스텀된 사용자의 endpoint 를 쓰겠다
CUSTOM_API_URL=http://host.docker.internal:8000/v1
CUSTOM_ENDPOINTS_ENABLED=true
MY_API_KEY=내gemini키를넣어주었다
  1. docker-compose.yaml
중얅...
volumes:
      - type: bind
        source: ./.env
        target: /app/.env
   		# 볼륨에 librechat.yaml 을 배포된 도커의 app 밑에 librechat.yaml 로 바인딩 
      - type: bind
        source: ./librechat.yaml
        target: /app/librechat.yaml
  1. librechat.yaml
중략...
custom:
    - name: 'My FastAPI LLM'
      apiKey: '${MY_API_KEY}'
      baseURL: '${CUSTOM_API_URL}'
      models:
        default: ['company-rag-bot']
        fetch: false
      titleConvo: true
      titleModel: 'company-rag-bot'
      modelDisplayLabel: 'My LLM'
      timeoutMs: 120000

.env 에서 url 가져오고, api key 가져와서 쓴다
모델 default 부분은 fastapi 서버에서 지정해 준것이다 (본인 지정)
timeout 은 처음에 짧았으나 로컬llm에서 답변이 늦어 늘려주었다

profile
개발 정리 공간 - 업무일때도 있고, 공부일때도 있고...

0개의 댓글