LLM-Engineers-Handbook

(★ 5,287)

The LLM's practical guide: From the fundamentals to deploying advanced LLM and RAG apps to AWS using LLMOps best practices

File Explorer

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

# Installation Guide

python
Prerequisites

Setup Steps

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

Clone the repository and move to the project directory.

cp .env.example .env

Create the environment configuration file.

poetry env use 3.11

Set Python 3.11 environment using Poetry.

poetry install --without aws

Install project dependencies excluding AWS specific packages.

poetry run pre-commit install

Set up pre-commit hooks for code verification.

poetry shell

Activate the Poetry virtual environment.

Key Commands

poetry install --without aws

Install Python package dependencies for the project.

poetry run pre-commit install

Install pre-commit hooks for code quality verification.

poetry shell

Launch the poetry virtual environment shell.

poetry poe local-infrastructure-up

Start local infrastructure using Docker.

You must fill in your OpenAI and Hugging Face API keys in the `.env` file before running.

# Use via CDN

jsDelivr

jsDelivr serves any public GitHub repository as a CDN with zero setup. Pick a version and a file to get a ready-to-paste link and snippet.

Command Glossary

Commands referenced in this DOCs, explained below.

🔍

username

View Details ▼

Manage users.
Accessed in configuration mode.

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

Set up an admin account:

🔍

git clone

View Details ▼

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

View Details ▼

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

View Details ▼

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

View Details ▼

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

View Details ▼

Manage Python packages and dependencies.
Some subcommands such as `about`, `check`, `env`, etc. have their own usage documentation.
See also: `asdf`, `pipenv`, `hatch`.

poetry new {{project_name}}

Create a new Poetry project in the directory with a specific name:

poetry add {{dependency}}

Install and add a dependency and its sub-dependencies to the `pyproject.toml` file in the current directory:

poetry install

Install the project dependencies using the `pyproject.toml` file in the current directory:

🔍

pyenv

View Details ▼

Switch between multiple versions of Python easily.
See also: `asdf`.

pyenv commands

List all available commands:

pyenv versions

List all Python versions under the `${PYENV_ROOT}/versions` directory:

pyenv install --list

List all Python versions that can be installed from upstream:

🔍

python

View Details ▼

Python language interpreter.

python

Start a REPL (interactive shell):

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

Execute a specific Python file:

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

Execute a specific Python file and start a REPL:

🔍

links

View Details ▼

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