Applied AI

AI Engineer

LLMs, prompts, embeddings, RAG, LangChain and PySpark, from concept to code.

units
9
lessons
26
minutes
140
exercises
156

The first unit is free, no credit card required. The other 8 unlock when you buy the course or go Pro. Single course: $12.99, one-time payment.

What's in the course.

LLMs, prompts, embeddings, RAG, LangChain and PySpark.

9 units, 26 lessons, and about 140 minutes of practice, a few minutes at a time.

Tokens, context window, temperature and why models sometimes make things up.

In this unit, you'll learn to

  • Understand tokens and the context window
  • Choose the right temperature for each task
  • Recognise and reduce hallucinations

Lessons

  1. Tokens and context, unlocked6 exercises · 5 min
  2. Temperature and hallucination, unlocked6 exercises · 5 min

Try it for real.

Ready to build with AI? Real exercises from this course, solved step by step, exactly as they appear in the app.

156 exercises across 6 types in this course

  • Pick the best answer69
  • Write Python27
  • Match26
  • Fill in the code12
  • Put it in order12
  • Tap the chart10

Write Python. Python 3 running in your browser, nothing to install. Write it, run it, see the output.

Token budget

The excerpts are already sorted by relevance, with their size in characters. Use the rule of 4 characters per token (chars // 4). Go through the list and include each excerpt that still fits in the budget, skipping any that do not fit. Print the list of chosen names and then the total number of tokens.

excerpts = [ ("refund_policy", 1800), ("delivery_faq", 2600), ("general_terms", 5200), ("exchange_policy", 1400), ] budget = 1500 chosen = [] total = 0 for name, chars in excerpts: tokens = chars // 4 if total + tokens <= budget: chosen.append(name) total += tokens print(chosen) print(total)

Correct. The first two add up to 1,100 tokens. general_terms would cost another 1,300 and blow the budget, so it is left out, and exchange_policy still fits: 1,450 in total. RAG systems do this sum so the response is not pushed out of the window.

Practice exams for this course

This course prepares you for these exams. Try free questions before you practice in the app.