How to Use This Book
This chapter shows you how the book is organised and how to set up your computer for the examples.
Who This Book Is For
This book is for anyone who wants to understand AI and use it well, not only chat with it:
- Students who want to know what is happening inside a chatbot
- Developers who want to add AI features to their apps
- Freelancers and small business owners who want to save time and earn more
- Teachers and office workers who want to use AI safely
You do not need advanced maths. When we show a formula, we also show what it means in plain words.
How the Book Is Organised
| Part | What you learn | Do you need code? |
|---|---|---|
| AI Book Tutorial | How to use the book, what AI really is today | No |
| Part 1: How LLMs Work | Tokens, embeddings, attention, training | A little Python |
| Part 2: Building with AI | APIs, JSON, RAG, vector databases, tools, MCP, testing | Yes, Python and Node.js |
| Part 3: AI at Work | Coding assistants, freelancing, careers | Some |
| Part 4: Safety and the Future | Privacy, hallucinations, prompt injection, the road ahead | A little |
You can read it from start to end like a book. You can also jump to one part. If you are not a programmer, read Part 1, Part 3 and Part 4, and skim Part 2.
This Book and the Other AI Tutorials
Workownix has other free AI tutorials. This book links to them instead of repeating them:
| If you want... | Read |
|---|---|
| A gentle first look at AI and its history | AI Tutorial |
| How text, image and audio generation works | Gen AI Tutorial |
| How to write better prompts | Prompt Engineering Tutorial |
| A complete website chatbot | Chatbots Tutorial |
| Agents that plan and use tools | AI Agents Tutorial |
| Classic machine learning with data | Machine Learning Tutorial |
Setting Up Your Computer
For the code chapters you need:
- Python 3.10 or newer (see the Python Tutorial)
- Node.js 20 or newer (see the Node.js Tutorial)
- The NumPy library:
pip install numpy - A code editor such as VS Code
Many examples run fully offline on your computer. The examples that call a real AI model need an account with an AI provider.
Check your Python setup with this small script:
Example
import sys, os
print("Python version:", sys.version.split()[0])
print("Python 3.10 or newer:", sys.version_info >= (3, 10))
for name in ["AI_API_KEY", "AI_BASE_URL", "AI_MODEL"]:
print(name, "is set" if os.environ.get(name) else "is MISSING")Python version: 3.13.16 Python 3.10 or newer: True AI_API_KEY is MISSING AI_BASE_URL is MISSING AI_MODEL is MISSING
Your version number may be different. "MISSING" is normal until you add your settings.
Your Three AI Settings
Every API example in this book reads three settings from environment variables. This keeps your secret key out of your code. Create a file named .env in your project folder:
Example
AI_API_KEY=paste-your-key-here
AI_BASE_URL=https://api.example-provider.com/v1
AI_MODEL=the-model-name-from-your-providerAnd make sure Git never uploads it, by adding this line to a file named .gitignore:
Example
.envThe base URL and the model name come from your provider's documentation. We use these placeholders on purpose: model names change every few months, but the way you call them stays the same.
Never paste a real API key into a chat, a screenshot or a GitHub repository. Anyone who has it can spend your money.
How Each Chapter Works
Every chapter has a short introduction, examples with their real output, notes like the blue box above, and an exercise at the end. The last chapter is a quiz on the whole book.
Exercise
Exercise
Why does this book keep the API key in an environment variable?
