LLM Zoomcamp FAQ
Editing guidelines:
Yes, but if you want to receive a certificate, you need to submit your project while we’re still accepting submissions.
You don't need it. You're accepted. You can also just start learning and submitting homework (while the form is Open) without registering. It is not checked against any registered list. Registration is just to gauge interest before the start date.
The zoom link is only published to instructors/presenters/TAs.
Students participate via Youtube Live and submit questions to Slido (link would be pinned in the chat when Alexey goes Live). The video URL should be posted in the announcements channel on Telegram & Slack before it begins. Also, you will see it live on the DataTalksClub YouTube Channel.
Don’t post your questions in chat as it would be off-screen before the instructors/moderators have a chance to answer it if the room is very active.
Check the quota and reset cycle carefully - is the free hours per month or per week? Usually if you change the configuration, the free hours quota might also be adjusted,or it might be billed separately.
Use GPTs to find out. Some might have restrictions on what you can and cannot install, so be sure to read what is included in a free vs paid tier.
When you set up your account you are automatically assigned a random name such as “Lucid Elbakyan” for example. Click on the Jump to your record on the leaderboard link to find your entry.
If you want to see what your Display name is, click on the Edit Course Profile button.
No, you can only get a certificate if you finish the course with a “live” cohort.
We don't award certificates for the self-paced mode. The reason is you need to peer-review 3 capstone(s) after submitting your project.
You can only peer-review projects at the time the course is running; after the form is closed and the peer-review list is compiled.
Yes, you need to pass the Capstone project to get the certificate. Homework is not mandatory, though it is recommended for reinforcing concepts, and the points awarded count towards your rank on the leaderboard.
This course is being offered for the first time, and things will keep changing until a given module is ready, at which point it shall be announced. Working on the material/homework in advance will be at your own risk, as the final version could be different.
Summer 2025 (via Alexey).
Please check the bookmarks and pinned links, especially DataTalks.Club’s YouTube account.
Your WSL2 is set to use Y.Y GiB, not all your computer memory. Create .wslconfig file under your Windows user profile directory (C:\Users\YourUsername\.wslconfig) with the desired RAM allocation:
[wsl2]
memory=8GB
Restart WSL: wsl --shutdown
Run the free command to verify the changes. For more details, read this article.
Third-Party Login Failure
An error occurred while attempting to login via your third-party account.
The current solution is to use Google or Slack to login and submit homework answers as the root cause analysis for the GitHub issue is sporadic and doesn’t impact all users.
Langchain is a framework for building LLM-powered apps. We're not using it to learn the basics; think of it like learning HTML, CSS, and JavaScript before learning React or Angular.
Added by Marcelo Nieva
You may receive the following error when running the OpenAI chat.completions.create command due to insufficient credits in your OpenAI account:
NotFoundError: Error code: 404 - {'error': {'message': 'The model `gpt-4o` does not exist or you do not have access to it.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}} |
RateLimitError: Error code: 429 - {'error': {'message': 'You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.', 'type': 'insufficient_quota', 'param': None, 'code': 'insufficient_quota'}
The above errors are related to your OpenAI API account’s quota.
There is no free usage of OpenAI’s API so you will be required to add funds using a credit card (see pay as you go in the OpenAI settings at platform.openai.com). Once added, re-run your python command and you should receive a successful return code.
Steps to resolve:
Update openai version from 0.27.0 -> any 1.x version
Using the Openai API does not cost much, you can recharge from 5 dollars. At least for what I spent on the first unit it was barely 5 cents.
No, you don't have to pay for this service in order to complete the course homeworks, you could use some of the alternatives free from this list posted into the course Github.
llm-zoomcamp/01-intro/open-ai-alternatives.md at main · DataTalksClub/llm-zoomcamp (github.com)
Reason: Elastic search client and server are on different versions
Solution: Upgrade the Elastic search on Docker to version 9
docker run -it \
--rm \
--name elasticsearch \
-p 9200:9200 \
-p 9300:9300 \
-e "discovery.type=single-node" \
-e "xpack.security.enabled=false" \
elasticsearch:9.0.1
If upgrading to version 9 doesn’t work, check the client version (python module) using `pip show elasticsearch`. Then install that specific version of Elastic Search on Docker. Check if it worked using `curl http://localhost:9200`. Example output of `pip show elastic search`:
Name: elasticsearch
Version: 9.0.2
Summary: Python client for Elasticsearch
Home-page: https://github.com/elastic/elasticsearch-py
Author:
Author-email: Elastic Client Library Maintainers <[email protected]>
License-Expression: Apache-2.0
Location: /home/codespace/.python/current/lib/python3.12/site-packages
Requires: elastic-transport, python-dateutil, typing-extensions
Required-by:
When try to connect to the Elasticsearch server/node version 8.17.6 (as instructed for the Homework 1) running from with the Docker container with the python client elasticsearch version 9.x or more, we run into the BadRequestError mentioned above.
This happens because pip install elasticsearch install elasticsearch 9.x python client which runs into compatibility issues with the Elasticsearch 8.17.6. So we can use
pip install "elasticsearch>=8,<9" for mitigation of the problem.
(Added by Siddhartha Gogoi)
If you get this error, it’s likely that elasticsearch doesn’t get enough RAM
I specified the RAM size to the configuration (-m 4GB)
docker run -it \
--rm \
--name elasticsearch \
-m 4GB \
-p 9200:9200 \
-p 9300:9300 \
-e "discovery.type=single-node" \
-e "xpack.security.enabled=false" \
docker.elastic.co/elasticsearch/elasticsearch:8.4.3
(-m 2gb should also work)
Another possible solution may be to set the memory_lock to false:
docker run -it \
--rm \
--name elasticsearch \
-p 9200:9200 \
-p 9300:9300 \
-e "discovery.type=single-node" \
-e see"xpack.security.enabled=false" \
-e "ES_JAVA_OPTS=-Xms512m -Xmx512m" \
-e "bootstrap.memory_lock=false" \
docker.elastic.co/elasticsearch/elasticsearch:8.4.3
Instead of document as used in the course video, use doc
When you stop the container, the data you previously added to elastic will be gone. To avoid it, we can add volume mapping:
docker volume create elasticsearch_data
docker run -it \
--rm \
--name elasticsearch \
-p 9200:9200 \
-p 9300:9300 \
-v elasticsearch_data:/usr/share/elasticsearch/data \
-e "discovery.type=single-node" \
-e "xpack.security.enabled=false" \
docker.elastic.co/elasticsearch/elasticsearch:8.4.3
You can store your different API keys in a yaml file that you will add in your .gitignore file. Be careful to never push or share this file.
#api_keys
api_keys.yml
OPENAI_API_KEY: “sk[...]”
GROQ_API_KEY: “gqk_[...]”
pip install pyyaml
import yaml
# Open the file
with open('api_keys.yml', 'r') as file:
# Load the data from the file
data = yaml.safe_load(file)
# Get the API key (Groq example here)
groq_api_key = data['GROQ_API_KEY']
Added by Mélanie Fouesnard
Store the API key in a .env file, then
import os
from dotenv import load_dotenv
load_dotenv(os.path.abspath("<path-to-.env>"))
os.getenv("API_KEY_abc")
Make sure to add the .env file in the .gitignore.
created the .envrc file & added my API key, ran direnv allow in the terminal
was getting an error: "OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable"
resolution: install dotenv & add the following to a cell in the notebook. You can install dotenv by running: pip install python-dotenv.
from dotenv import load_dotenv
load_dotenv('.envrc')
The question asks for the number of tokens in gpt-4o model. tiktoken is a python library that can be used to get the number of tokens. You don't need openai api key to to get the number of tokens. You can use the code provided in the question to get the number of tokens.
You can use any LLM platform for your experiments and your project. Also, the homework is designed in such a way that you don’t need to have access to any paid services and can do it locally. However, you would need to adjust the code for that platform. See their documentation pages.
Yes. See module 2 and the open-ai-alternatives.md in module 1 folder.
This is likely to be an error when indexing the data. First you need to add the index settings before adding the data to the indices, then you will be good to go applying your filters and query.
The correct package name for docx is python-docx, not docx.
When using tiktoken.encode() to count tokens in your prompt, you might get a number like 320, while OpenAI’s API response reports something like 327. This is expected and due to internal tokens added by OpenAI’s chat formatting.
Here’s what happens under the hood:
So even if your visible text is 320 tokens, OpenAI may count 327 due to these internal additions.
Added by José Luis Martínez (Maxkaizo)
First, install Ollama:
Go to https://ollama.com/download
Choose your operating system:
curl -fsSL https://ollama.com/install.sh | sh
Open a terminal and type:
ollama run llama3
This will:
To test the Ollama local server, execute the following command:
curl http://localhost:11434
You should receive something like:
{"models": [...]}
Then, install the Python client:
pip install ollama
Here, you have a minimal python example:
import ollama
response = ollama.chat(
model='llama3',
messages=[{"role": "user", "content": your_prompt}]
)
print(response['message']['content'])
Added by Alexander Daniel Rios
The solution is to delete any potential existing index with the same name before attempting to create the index (see code snippet below).
# Check if the index exists and delete it if it does
if es_client.indices.exists(index=index_name):
print(f"Deleting existing index: {index_name}")
es_client.indices.delete(index=index_name)
print(f"Index {index_name} deleted.")
However, with this approach sometimes when you re-run the code multiple times, the index gets messed up and you for example will see a different score output each time you execute the code for question#3 in homework1. To fix this 1) Go to docker desktop and stop Elasticsearch container , delete the container image and re-initiate the Elasticsearch container by creating it from scratch per the instructions ‘1.6 Searching with ElasticSearch’ 2) Change the name of the index in your code to anything other than -> index_name = "course-questions"
Answer
The issue is likely that you’re trying to use HTTPS instead of HTTP when you call local.
To remove ES authentication constraints, set xpack.security.enabled=false in the ES docker settings.
Embeddings = turning non-numerical data into numerical data, while preserving meaning and context. Similar non-numerical data, when entered into an embedding algorithm, should produce similar numerical data. The similar numerical data being close in mathematical values allows for mathematical semantic similarity algorithms to be leveraged. See, also, “vector space model” and “dimensionality reduction”.
max_value = numpy_array.max()
Cosine similarity is a measure used to calculate the similarity between two non-zero vectors, often used in text analysis to determine how similar two documents are based on their content. This metric computes the cosine of the angle between two vectors, which are typically word counts or TF-IDF values of the documents. The cosine similarity value ranges from -1 to 1, where 1 indicates that the vectors are identical, 0 indicates that the vectors are orthogonal (no similarity), and -1 represents completely opposite vectors.
Yes, there are other vector databases, for example Milvus, which is open sourced and you can see the documentation here: https://milvus.io/docs/overview.md
Cosine similarity measures how aligned two vectors are, regardless of their magnitude. When all vectors (including the query) are normalized to unit length, their magnitudes no longer matter. In this case, cosine similarity is equivalent to simply taking the dot product between the query and each document embedding. This allows us to compute similarities efficiently using matrix multiplication.
Added by José Luis Martínez
If you're running the `docker run` command on **Windows (especially Command Prompt or PowerShell)** and you use `$(pwd)` to mount a volume, you'll likely get the following error:
docker: invalid reference format.
Answer: The expression $(pwd) is a Unix-style command used to get the current working directory. It **won’t work in Windows**, which causes Docker to misinterpret the image name or the `-v` argument, hence the “invalid reference format” error.
Solution:
1. Use the full absolute path instead of $(pwd), for example:
docker run -p 6333:6333 -p 6334:6334 \
-v C:/Users/youruser/path/to/qdrant_storage:/qdrant/storage:z \
qdrant/qdrant
2. Alternatively, use a named volume, as shown in the video:
docker volume create qdrant_storage
docker run -p 6333:6333 -p 6334:6334 \
-v qdrant_storage:/qdrant/storage \
qdrant/qdrant
Added by José Luis Martínez
If you use Anaconda or Miniconda, you can try re-installing onnxruntime with conda
conda install -c conda-forge onnxruntime
One of the ways you can create an environment to use "qdrant-client[fastembed]>=1.14.2" which throws this error is to create the environment using Conda. Here are the steps -
Use the former if you are running Qdrant in Docker locally and it connects your notebook to the Qdrant server running in Docker.
The latter option creates an in-memory Qdrant instance that runs inside your Python process (no Docker, no persistence, no networking). It’s:
If you're working with Jupyter notebooks, make sure the kernel you're using has the correct version of minsearch. You can check the version in your kernel with: minsearch.__version__
You can also try installing the latest version directly from a notebook cell using:
%pip install -U minsearch
%pip is a Jupyter magic command that makes sure the package gets installed in the same environment your notebook kernel is using (unlike !pip, which might install it somewhere else).
Added by Marcelo Nieva
Answer: In the lesson, .dot(...) was used under the assumption that the embeddings returned by the model (e.g. model.encode(...) from OpenAI) are already normalized to have unit length. In that case, the dot product is mathematically equivalent to cosine similarity.
In the homework, however, we use classic embeddings like TF-IDF + SVD, which are not normalized by default. This means that the dot product does not represent cosine similarity unless we manually normalize the vectors.
Added by José Luis Martínez
Answer
Upgrade `sentence-transformers` to v3.0.0>= e.x pip install sentence-transformers>=3.0.0 to avoid the warnings
Solution 1 : Install Visual C++ Redistributable
Solution 2 : Install Visual Studio, not Visual Studio Code. Like in this depicted below and restart your system. For more details, please follow this link : https://discuss.pytorch.org/t/failed-to-import-pytorch-fbgemm-dll-or-one-of-its-dependencies-is-missing/201969
Inside .env file change POSTGRES_HOST=localhost
By default, in the dataframe visualization, Pandas truncate the text content in a column to 50 characters. In order to view the entire explanation given by the judge llm for a NON RELEVANT answer, as in figure:
The instruction to show the results must be preceded by:
pd.set_option('display.max_colwidth', None)
Here are the specs for the display_max_colwidth option, as describide in the official docs:
display.max_colwidth : int or None
The maximum width in characters of a column in the repr of
a pandas data structure. When the column overflows, a "..."
placeholder is embedded in the output. A 'None' value means unlimited.
[default: 50] [currently: 50]
import numpy as np
normalize_vec = lambda v: v / np.linalg.norm(v)
df["new_col"] = df["org_col"].apply(norm_vec)
To compute the 75% percentile or 0.75 quantile:
quantile: int = df["col"].quantile(q=0.75)
1. Delete all containers (including running ones):
```
docker rm -f
```
2. Remove all images:
```
docker rmi -f
```
3. Delete all volumes:
```
docker volume rm
```
Solved:
https://discuss.streamlit.io/t/streamlit-session-attributes-reassigned-somewhere/76059/2?u=mohammed2
Make sure to create a Dockerfile and run ‘docker-compose up –build’ when adding streamlit to docker-compose
Answer
Answer
No, the capstone is a solo project.
No, it does not (answered in office hours Jul 1st, 2024). You can participate in the math-kaggle-llm-competition as a group if you want to form teams; but capstone is an individual attempt.
After the submission deadline has passed, an Excelsheet will be shared with 3 projects being assigned to each participant.
Once the project submission deadline has passed, we will be assigned projects to evaluate. You can't choose which projects to evaluate, and you can’t review before the list has been released.
Answer: Please check https://github.com/DataTalksClub/llm-zoomcamp/blob/main/project.md for several ideas and datasets that could be used for the project, along with tips and guidelines.
Answer: No, you don’t have to use ElasticSearch. You can use any library you want. Just make sure it is documented so your peer-reviewers can reproduce your project.
You could use some of this free alternatives for elastic search
Let's imagine, today I start using multi-qa-distilbert-cos-v1 (https://huggingface.co/sentence-transformers/multi-qa-distilbert-cos-v1).
I create embeddings and index them.
Tomorrow, the author of the model decides to update it because of some reason.
What happens with all indexed embeddings? Do they become incompatible and I will need to re-index everything?
There is an option to save the model locally also. This way even if the cloud model changes your code should work.
Answer
Since dlt is open-source, we can use the content of this workshop for a capstone project. Since the main goal of dlt is to load and store data easily, we can even use it for other zoomcamps (mlops zoomcamp project for example). Do not hesitate to ask questions or use it directly in your projects.
Added by Mélanie Fouesnard
Start with “dlt init filesystem duckdb” on the command line.
More directions: https://dlthub.com/docs/tutorial/filesystem
The error indicates that you have not changed all instances of “employee_handbook” to “homework” in your pipeline settings
Make sure you open the correct table in line 3: dbtable = db.open_table("notion_pages___homework")T
You can use the db.table_names() to list all the tables in the db
Currently, DLT does not have connectors for ClickHouse or StarRocks but are open to contributions from the community to add these connectors.
If you get this error
Or 401 Client Error , then you either need to grant access to the key or the key is wrong.
Install directly from source E.g `pip install "requests @ https://github.com/psf/requests/archive/refs/tags/v2.32.3.zip"`
Answer:The total cost is approximately $0.09 USD, based on pricing as of July 7, 2025.
This estimate includes all API calls to OpenAI for generating embeddings and relationship extraction, as well as local operations for loading data into Qdrant and Kuzu.
Added by José Luis Martínez
If you get this error while doing the homework , simply restart the ollama server using nohup y running this line of the notebook !nohup ollama serve > nohup.out 2>&1 &
If you do stop and restart the cell, you will need to rerun the cell containing ollama serve first.
Try removing driver bridge from there?
Added by Abiodun Gbadamosi
Multiple retrieval approaches are evaluated, and the best one is used (2 points) I am trying to evaluate a project. The person use only minsearch for evaluated but did boosting and got boostin parameter posted. Do they get one mark?
Answer
Here you go:
The evaluation criteria state that to receive 2 points, multiple RAG approaches must be evaluated, and the best one must be used. Since the individual in question is using only minsearch for evaluation, despite applying boosting, this would not qualify as evaluating multiple RAG approaches.
Therefore, they would receive only 1 point for utilizing a single RAG approach (minsearch) in their evaluation, even though they incorporated a boosting parameter. The boosting itself does not constitute a separate approach; it is simply an enhancement applied to the single method being used.
Added by Wali Mohamed
Error : elasticsearch.BadRequestError: BadRequestError(400, 'media_type_header_exception', 'Invalid media-type value on headers [Content-Type, Accept]', Accept version must be either version 8 or 7, but found 9. Accept=application/vnd.elasticsearch+json; compatible-with=9)
Fix :
pip uninstall elasticsearch
pip install elasticsearch==8.10.0
Error: 'ImportError: cannot import name 'AppendableIndex' from 'minsearch''
Fix: pip install --upgrade minsearch
(minsearch 0.0.4 works well; jupyter kernel restarting is needed after this upgrade)
Error: 'ImportError: cannot import name 'AppendableIndex' from 'minsearch''
Fix: from minsearch.append import AppendableIndex
Error: 'ImportError: cannot import name 'AppendableIndex' from 'minsearch''
Fix: Rename the previously downloaded minsearch.py file to avoid conflicts, then reinstall minsearch using pip so the import works correctly.
Several Groq models offer tool use, such as Deepseek R1 or Llama 4, all of which can be used for free for development
https://console.groq.com/docs/tool-use
Added by Marcelo Nieva
Yes — in Python, float is a numeric type. But when working with FastMCP, tool inputs are validated against JSON Schema, which uses the term "number" to represent any numeric value (integers or floats).
The important thing is not the type you use in Python, but whether the JSON you send matches the tool's declared input schema.
Example:
"inputSchema": {
"type": "object",
"properties": {
"temp": {
"type": "number"
}
},
"required": ["temp"]
}
Make sure the values in "arguments" match the types declared in the tool’s schema — not Python types, but JSON types (string, number, boolean, etc.).
Added by Maxkaizo - José Luis Martínez
1. Node should be installed
2. To install the MCP Inspector, simply run the following command in your terminal:
npm i @modelcontextprotocol/inspector
· Run from the terminal the following
npx @modelcontextprotocol/inspector
· Connect to the MCP Server
· The inspector can list tools, templates, resources and prompts from the MCP Server
Reference
https://medium.com/@anil.goyal0057/how-to-test-your-mcp-server-using-mcp-inspector-c873c417eec1
Added - Sundara Kumar Padmanabhan
Jupyter notebooks already run an event loop in the main thread to handle asynchronous code. For this reason, when you try to call asyncio.run() inside a cell, you get the following error:
RuntimeError: asyncio.run() cannot be called from a running event loop
Instead of using asyncio.run(), simply use await directly in the notebook cell.
Incorrect:
import asyncio
async def main():
async with Client(weather_server.mcp) as mcp_client:
# your code here
# This will cause the RuntimeError
result = asyncio.run(main())
Correct:
async def main():
async with Client(weather_server.mcp) as mcp_client:
# your code here
# Use await directly
result = await main()
Jupyter notebooks automatically create an asyncio event loop when they start. Since asyncio.run() attempts to create a new event loop, it conflicts with the existing loop. By using await directly, you leverage the already running event loop.
Added by Marcelo Nieva