LLM-Engineers-Handbook

(★ 5,287)

LLM 실전 가이드: 기초부터 LLMOps 모범 사례를 활용한 고급 LLM 및 RAG 애플리케이션의 AWS 배포까지

파일 탐색기

  • .env.example
  • .gitignore
  • .pre-commit-config.yaml
  • .python-version
  • docker-compose.yml
  • Dockerfile
  • LICENSE
  • poetry.lock
  • pyproject.toml
  • README.md
  • ruff.toml

# 설치 가이드

python
사전 준비물

설치 및 실행 절차

git clone https://github.com/PacktPublishing/LLM-Engineers-Handbook.git && cd LLM-Engineers-Handbook

저장소를 클론하고 프로젝트 폴더로 이동합니다.

cp .env.example .env

환경 변수 설정 파일을 생성합니다.

poetry env use 3.11

파이썬 3.11 환경을 포에버로 설정합니다.

poetry install --without aws

AWS 종속성을 제외한 프로젝트 패키지를 설치합니다.

poetry run pre-commit install

코드 검증을 위한 pre-commit 훅을 설정합니다.

poetry shell

포에버 가상환경을 활성화합니다.

핵심 명령어

poetry install --without aws

프로젝트의 Python 패키지 의존성을 설치합니다.

poetry run pre-commit install

코드 품질 검증을 위한 pre-commit을 설치합니다.

poetry shell

프로젝트의 가상환경 셸을 실행합니다.

poetry poe local-infrastructure-up

로컬 개발용 인프라(Docker)를 실행합니다.

실행 전 `.env` 파일에 OpenAI 및 Hugging Face API 키를 필수로 입력해야 합니다.

# CDN으로 사용하기

jsDelivr

jsDelivr는 공개 GitHub 리포지토리를 별도 설정 없이 CDN으로 즉시 서빙합니다. 버전과 파일을 고르면 웹페이지에 바로 붙일 수 있는 링크와 예시 코드가 만들어집니다.

명령어 용어집

이 문서에서 사용된 명령어를 모아봤습니다. 낯선 명령어가 있다면 펼쳐서 확인해보세요.

🔍

username

설명 보기 ▼

사용자를 관리.
설정 모드에서 사용.
더 많은 정보: <https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/security/s1/sec-s1-xe-3se-3850-cr-book/sec-s1-xe-3se-3850-cr-book_chapter_0110.html>.

username {{admin}} privilege 15 secret {{password}}

관리자 계정 생성:

🔍

git clone

설명 보기 ▼

Clone an existing repository.

git clone {{remote_repository_location}} {{path/to/directory}}

Clone an existing repository into a new directory (the default directory is the repository name):

git clone --recursive {{remote_repository_location}}

Clone an existing repository and its submodules:

git clone {{[-n|--no-checkout]}} {{remote_repository_location}}

Clone only the `.git` directory of an existing repository:

🔍

poetry install

설명 보기 ▼

Install all dependencies for a Python project as defined in the pyproject.toml file.

poetry install

Install dependencies:

poetry install --no-root

Skip installing the project itself as a dependency:

poetry install --without dev

Install only production dependencies:

🔍

poetry run

설명 보기 ▼

Run a command in the project's virtual environment.

poetry run {{command}}

Run a command inside the virtual environment:

poetry run {{command}} {{argument1 argument2 ...}}

Run a command with arguments:

poetry run {{script_name}}

Run a script defined in `pyproject.toml`:

🔍

poetry shell

설명 보기 ▼

Spawn a shell within the virtual environment.
Note: The `shell` command was moved to a plugin: `poetry-plugin-shell`.

poetry shell

Spawn a shell within the virtual environment:

🔍

poetry

설명 보기 ▼

Python 패키지 및 의존성을 관리.
관련 항목: `asdf`, `pipenv`, `hatch`.
더 많은 정보: <https://python-poetry.org/docs/cli/>.

poetry new {{project_name}}

특정 이름으로 디렉토리에 새 Poetry 프로젝트 생성:

poetry add {{dependency}}

현재 디렉토리의 `pyproject.toml` 파일에 의존성과 그 하위 의존성 설치 및 추가:

poetry install

현재 디렉토리의 `pyproject.toml` 파일을 사용하여 프로젝트 의존성 설치:

🔍

pyenv

설명 보기 ▼

여러 버전의 Python 사이를 쉽게 전환.
관련 항목: `asdf`.
더 많은 정보: <https://manned.org/pyenv>.

pyenv commands

사용 가능한 모든 명령 나열:

pyenv versions

`${PYENV_ROOT}/versions` 디렉토리 아래의 모든 Python 버전 나열:

pyenv install --list

업스트림에서 설치할 수 있는 모든 Python 버전 나열:

🔍

python

설명 보기 ▼

Python 언어 인터프리터.
더 많은 정보: <https://docs.python.org/using/cmdline.html>.

python

REPL(대화형 셸) 시작:

python {{path/to/file.py}}

특정 Python 파일 실행:

python -i {{path/to/file.py}}

특정 Python 파일 실행 후 REPL 시작:

🔍

links

설명 보기 ▼

Command-line text-only web browser.
See also: `links2`.

links {{https://example.com}}

Visit a website:

links -anonymous {{https://example.com}}

Apply restrictions for anonymous account:

links -enable-cookies {{0|1}} {{https://example.com}}

Enable Cookies (`1` to enable):

// repository documentation