LLM-Engineers-Handbook
The LLM's practical guide: From the fundamentals to deploying advanced LLM and RAG apps to AWS using LLMOps best practices
File Explorer
- cd.yaml
- ci.yaml
- settings.json
- 03_custom_odm_example.py
- 03_orm.py
- 08_instructor_embeddings.py
- 08_text_embeddings.py
- 08_text_image_embeddings.py
- digital_data_etl_maxime_labonne.yaml
- digital_data_etl_paul_iusztin.yaml
- end_to_end_data.yaml
- evaluating.yaml
- export_artifact_to_json.yaml
- feature_engineering.yaml
- generate_instruct_datasets.yaml
- generate_preference_datasets.yaml
- training.yaml
- cleaned_documents.json
- instruct_datasets.json
- preference_datasets.json
- raw_documents.json
- ArticleDocument.json
- PostDocument.json
- RepositoryDocument.json
- UserDocument.json
- cover_plus.png
- crazy_cat.jpg
- __init__.py
- base.py
- custom_article.py
- dispatcher.py
- github.py
- linkedin.py
- medium.py
- __init__.py
- constants.py
- generation.py
- output_parsers.py
- utils.py
- __init__.py
- base.py
- embeddings.py
- __init__.py
- chunking.py
- cleaning.py
- __init__.py
- chunking_data_handlers.py
- cleaning_data_handlers.py
- dispatchers.py
- embedding_data_handlers.py
- __init__.py
- base.py
- prompt_templates.py
- query_expanison.py
- reranking.py
- retriever.py
- self_query.py
- __init__.py
- misc.py
- split_user_full_name.py
- __init__.py
- __init__.py
- nosql.py
- vector.py
- __init__.py
- chunks.py
- cleaned_documents.py
- dataset.py
- documents.py
- embedded_chunks.py
- exceptions.py
- inference.py
- prompt.py
- queries.py
- types.py
- __init__.py
- config.py
- run.py
- sagemaker_huggingface.py
- __init__.py
- autoscaling_sagemaker_endpoint.py
- delete_sagemaker_endpoint.py
- create_execution_role.py
- create_sagemaker_role.py
- __init__.py
- mongo.py
- qdrant.py
- __init__.py
- files_io.py
- inference_pipeline_api.py
- opik_utils.py
- __init__.py
- evaluate.py
- requirements.txt
- sagemaker.py
- __init__.py
- finetune.py
- requirements.txt
- sagemaker.py
- __init__.py
- inference.py
- run.py
- test.py
- __init__.py
- Readme.md
- utils.py
- __init__.py
- settings.py
- __init__.py
- digital_data_etl.py
- end_to_end_data.py
- evaluating.py
- export_artifact_to_json.py
- feature_engineering.py
- generate_datasets.py
- training.py
- __init__.py
- crawl_links.py
- get_or_create_user.py
- __init__.py
- evaluate.py
- __init__.py
- serialize_artifact.py
- to_json.py
- __init__.py
- clean.py
- load_to_vector_db.py
- query_data_warehouse.py
- rag.py
- __init__.py
- create_prompts.py
- generate_intruction_dataset.py
- generate_preference_dataset.py
- push_to_huggingface.py
- query_feature_store.py
- __init__.py
- train.py
- __init__.py
- __init__.py
- integration_example_test.py
- __init__.py
- unit_example_test.py
- __init__.py
- __init__.py
- data_warehouse.py
- ml_service.py
- rag.py
- run.py
- .env.example
- .gitignore
- .pre-commit-config.yaml
- .python-version
- docker-compose.yml
- Dockerfile
- LICENSE
- poetry.lock
- pyproject.toml
- README.md
- ruff.toml
# Installation Guide
pythonSetup 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.
# Use via CDN
jsDelivrjsDelivr 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 ▼
username
Manage users.
Accessed in configuration mode.
username {{admin}} privilege 15 secret {{password}}
Set up an admin account:
git clone
View Details ▼
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
View Details ▼
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
View Details ▼
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
View Details ▼
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
View Details ▼
poetry
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 ▼
pyenv
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
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 ▼
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):
