BIP on AI Agents

Blended Intensive Programme — Universidad de Málaga

Everything you need to prepare your homework, advance your work, and collaborate with other participants.

During this BIP you will use TOMMI Lite, a lightweight framework for building and testing AI agents. This page contains everything BIP participants need to prepare before the 15th of June. Please complete the following tasks:

  1. Learn to use a terminal — Read through Section 1 below and practise opening a terminal on your computer, navigating folders, and running basic commands.
  2. Create a free* ( New) or payable Mistral account — Go to console.mistral.ai and sign up. You can now choose between a free Experiment plan or a paid plan. Both work with TOMMI Lite. See Section 1b below for detailed instructions on both options. Generate an API key and keep it at hand for the next step.*
  3. * Note: During the virtual session we were not aware that MISTRAL offered also free accounts. Apparently these free accounts should be enough for you to complete this BIP satisfactorily. Sorry about the confusion and see you soon in Málaga! 

  4. Download and install TOMMI LiteDownload the zip for your operating system (Section 2), extract it, configure your API key in env.txt, and start the server following the instructions in Section 3.
  5. Test at least one or two AI agents — Once the server is running, open http://localhost:8000 in your browser, select an agent from the sidebar (e.g. Hello World), and have a short conversation to confirm everything works.
Go further: Inside TOMMI Lite you will find links to the Step-by-Step Guide and the Course Book in the sidebar. We recommend reading through them to familiarise yourself with the framework before the BIP — it will help you get the most out of the sessions.

Before You Arrive: What to Bring

For the in-person component of the BIP, please make sure you have the following ready before you arrive in Málaga:

Equipment

  • A laptop with Wi-Fi access — you will be working on your own machine throughout all sessions.
  • A Mistral account (a free account is sufficient — see Section 1b) with a working API key configured in TOMMI Lite.

Data for Your Own Agent (optional but recommended)

If you would like to go beyond the provided examples and build one or more agents that you can actually use in your work afterwards, you will need to bring the relevant data with you. The type of data depends on the task you have in mind. Here are some examples:

Lecturer / Teacher

If you want to build an agent to support your teaching — for example, to answer student questions or help explain course content — bring your lecture notes, slides, or course materials.

Student / Researcher

If you want an agent that can help you summarise or analyse papers in your area of research, bring the papers or documents you work with most frequently. PDF files work well.

Administrative Staff

If you want an agent that can help you consult or navigate a database or document collection, bring a sample of the type of database or document you work with. It does not need to contain real or sensitive data — a representative structure or a small anonymised example is enough.

Think ahead: The most time-consuming part of building a useful agent is gathering and preparing the data that feeds it. Before you arrive, take a moment to think about what task you want your agent to perform and collect at least part of the material it will need. Even a partial dataset is a great starting point.

1. Terminal Basics

A terminal (also called "command line" or "console") is a text-based interface where you type commands to interact with your computer. You will need it to run TOMMI Lite and manage your AI agents.

Why do I need a terminal? TOMMI Lite is started from the terminal, and some setup steps (installing Python packages, downloading models) require terminal commands. Don't worry — you only need a few basic commands.

macOS

Opening the Terminal

  1. Press Cmd + Space to open Spotlight Search
  2. Type Terminal and press Enter
  3. A window with a command prompt will appear (usually showing your username and a % or $ sign)

Alternatively: open Finder > Applications > Utilities > Terminal

Essential Mac Commands

CommandWhat it doesExample
cd folder_nameChange directory (move into a folder)cd Downloads/tommilite
cd ..Go up one folder levelcd ..
lsList files in current folderls
pwdShow current folder pathpwd
python3 --versionCheck if Python is installedpython3 --version
./start.shRun a shell script./start.sh
Ctrl + CStop a running program(press keys together)

Example: Starting TOMMI Lite on Mac

# Navigate to the TOMMI Lite folder
cd ~/Downloads/tommilite

# Start the server
./start.sh
Tip: You can drag a folder from Finder into the Terminal window to paste its full path.

Windows

Opening the Terminal

Windows has several terminal options. We recommend PowerShell or Command Prompt:

  1. Press Win + R, type cmd and press Enter (for Command Prompt)
  2. Or: press Win + X and select "Windows Terminal" or "PowerShell"
  3. Or: search "PowerShell" in the Start menu

Essential Windows Commands

CommandWhat it doesExample
cd folder_nameChange directorycd Downloads\tommilite
cd ..Go up one folder levelcd ..
dirList files in current folderdir
cdShow current folder path (no arguments)cd
python --versionCheck if Python is installedpython --version
start.batRun a batch scriptstart.bat
Ctrl + CStop a running program(press keys together)

Example: Starting TOMMI Lite on Windows

:: Navigate to the TOMMI Lite folder
cd C:\Users\YourName\Downloads\tommilite

:: Start the server
start.bat
Note: On Windows, use python (not python3). If python doesn't work, you may need to install Python from python.org and make sure to check "Add Python to PATH" during installation.

Common Tips

  • Tab completion: Press Tab while typing a folder or file name to auto-complete it.
  • Command history: Press the Up arrow key to recall previous commands.
  • Copy/Paste: On Mac, use Cmd+C / Cmd+V. On Windows terminal, use Ctrl+Shift+C / Ctrl+Shift+V (or right-click to paste).
  • If something goes wrong: Press Ctrl + C to stop whatever is running, then try again.

New 1b. Create Your Mistral Account

What changed? Mistral now offers a free "Experiment" plan that gives you 1 billion tokens per month at no cost — more than enough for this course. During the virtual session we were not aware of this option, so we only mentioned paid plans. You can now use Mistral for free.

Step 1: Sign Up

  1. Go to Mistral AI Studio.
  2. Click Sign Up and fill in your details.
  3. Verify your email address.

Step 2: Choose Your Plan

Once logged in, navigate to the Subscription section. You have two options:

New Free Experiment Plan (recommended)
  1. Select Experiment for free and click Subscribe.
  2. Verify your phone number (one phone number per account).
  3. Done! You get 1 billion tokens/month at no cost.
Best for most students. No credit card needed. More than enough for prototyping and testing your agents throughout the course.
Paid Plan (optional)
  1. Select a basic paid plan.
  2. Add a payment method (credit card).
  3. Basic plans start at a few euros and offer higher rate limits.
Only needed if you plan to make heavy use of the API beyond prototyping, or if you want higher rate limits.

Step 3: Generate an API Key

  1. In Mistral AI Studio, go to the API Keys section.
  2. Click Create New Key.
  3. Give your key a name (e.g., "AI Agent Project").
  4. Copy the generated API key and store it securely.
Important: The API key is shown only once. Make sure you copy it before closing the dialog.

Step 4: Add the Key to TOMMI Lite

Open the file env.txt in your tommi_lite folder with any text editor and paste your key:

# LLM Provider configuration
LLM_PROVIDER=mistral
MISTRAL_API_KEY=your_key_here
MISTRAL_MODEL=mistral-small-latest

Replace paste_your_key_here with the actual API key you copied in Step 3.

Tip: The file env.txt is already included in your TOMMI Lite folder with a placeholder value. You only need to replace the placeholder with your real key.
Security: Never share your env.txt file or commit it to a public repository. It contains your private API key.

Step 5: Monitor Usage

Check your usage and limits at any time in the Limits section of Mistral AI Studio.

2. Download TOMMI Lite

TOMMI Lite is the lightweight framework you will use to build and test AI agents during the BIP. Download the version for your operating system:

Windows

For Windows 10 / 11

Download for Windows

Mac / Linux

For macOS and Linux distributions

Download for Mac / Linux
What you get: A zip file containing the full TOMMI Lite framework. Unzip it to any folder on your computer and follow the setup instructions below.

3. Setting Up TOMMI Lite

Prerequisites

Computer

macOS, Linux, or Windows.

Python 3.10+

If not installed, start.sh will detect this and offer to install it automatically.

Basic Command Line Knowledge

See Section 2 above.

3.1 Choose a Large Language Model (LLM)

TOMMI Lite needs an LLM to power its agents. You have two options — choose one:

Option A: Mistral Cloud (API key — recommended)

Use Mistral's cloud servers. This is the recommended option for most participants, especially if you are not experienced with technical setup. No GPU needed, works on any computer. Requires an internet connection and an API key.

New Mistral now offers a free Experiment plan (1 billion tokens/month) — no credit card needed. A paid plan is also available if you need higher limits.

Setup: Follow the detailed instructions in Section 1b above to create your account, choose a plan, generate an API key, and configure env.txt.

Option B: Ollama (local, free — advanced users)

Run AI models locally on your own computer. No internet needed, no API key, completely free. However, this option requires a GPU (dedicated graphics card) and a more advanced technical background to install and troubleshoot. Recommended only if you are comfortable with system configuration and have a machine with a capable GPU (8+ GB VRAM recommended).

Setup:

  1. Download and install from ollama.com
  2. Open a terminal and download a model:
    ollama pull mistral
    This downloads about 4 GB (only needed once).
Other models: ollama pull llama3, ollama pull qwen2.5-coder, ollama pull gemma2
Which one should I choose?
  • Mistral Cloud (recommended) for most participants — faster setup, better responses, and works on any computer without special hardware.
  • Ollama only if you have a GPU, some technical experience, and want privacy (data stays on your machine).
You can switch between them at any time by editing env.txt.

3.2 Extract TOMMI Lite

Unzip the downloaded file to any folder on your computer. You will get a folder called tommi_lite containing all the necessary files.

Mac / Linux
Windows
# Navigate to where you downloaded the zip
cd ~/Downloads
unzip tommi_lite.zip
cd tommi_lite
:: Right-click tommi_lite.zip and select "Extract All"
:: Then open a Command Prompt and navigate to the folder:
cd %USERPROFILE%\Downloads\tommi_lite

3.3 Verify the folder structure

You should see these files:

tommi_lite/
  app.py              # Server
  agent_runner.py     # Agent engine
  llm_client.py       # LLM provider abstraction
  env.txt             # Configuration
  requirements.txt    # Python dependencies
  start.sh            # Mac/Linux startup
  start.bat           # Windows startup
  static/
    index.html        # Chat interface
    create.html       # Agent creator
  agents/
    hello_world/      # Example agent

3.4 Configure your API Key (Mistral Cloud only)

If you chose Mistral Cloud, open the file env.txt in the tommilite folder with any text editor:

# LLM Provider configuration
LLM_PROVIDER=mistral
MISTRAL_API_KEY=YOUR_MISTRAL_API_HERE
MISTRAL_MODEL=mistral-small-latest

Replace YOUR_MISTRAL_API_HERE with your actual Mistral API key (obtained from console.mistral.ai).

3.5 Start the Server

The start script automatically creates a Python virtual environment, installs dependencies, and starts the server.

Mac / Linux
Windows
./start.sh
Note: If you get "permission denied", run chmod +x start.sh first.
:: Double-click start.bat, or from Command Prompt:
start.bat

If Python is not installed, the script will ask you to accept its installation. Type Y (or just press Enter) to proceed.

The first time, it will also install dependencies (this takes about 30 seconds). You should see:

  TOMMI Lite running at http://localhost:8000

3.6 Open the Interface and Chat with an Agent

Open your browser and go to:

http://localhost:8000

You will see the TOMMI Lite interface, which has three main areas:

  • Sidebar (left) — Lists all available agents. You will see Hello World Agent pre-installed as an example.
  • Chat area (centre) — Where conversations with your agent take place. Messages appear here in real time as the agent responds.
  • Input bar (bottom) — Type your message and press Enter or click Send.

To start chatting:

  1. Click on an agent in the sidebar (e.g. Hello World) to select it.
  2. The agent's welcome message will appear in the chat area, along with example queries you can click.
  3. Type a message in the input bar and press Enter. The agent will stream its response in real time.
  4. To start a fresh conversation, click the "New Chat" button in the top bar.
Tip: If the Hello World agent responds correctly, your setup is complete and working. You are ready for the BIP!

4. Troubleshooting

Here are the most common issues encountered during setup and how to fix them:

"Permission denied" when running ./start.sh

The script does not have execute permissions. Run this command first:

chmod +x start.sh

Then try ./start.sh again.

"python" or "python3" is not recognised

Python is not installed or not in your system PATH.

  • Mac/Linux: The start script will offer to install Python automatically. Accept by typing Y.
  • Windows: Download Python from python.org. During installation, make sure to check "Add Python to PATH".

API key error / "Authentication failed"

Your Mistral API key is missing or incorrect.

  • Open env.txt and verify that MISTRAL_API_KEY contains your actual key with no extra spaces or quotes.
  • Make sure your Mistral account has an active plan (free Experiment plan or a paid plan).
  • After editing env.txt, restart the server (press Ctrl+C to stop, then run the start script again).

"Address already in use" / port 8000 conflict

Another program (or a previous TOMMI Lite instance) is already using port 8000.

  • Close the other terminal window running TOMMI Lite, or stop the other program.
  • On Mac/Linux: lsof -i :8000 to find what is using the port, then kill to stop it.
  • On Windows: netstat -ano | findstr :8000 to identify the process.

The page loads but the agent does not respond

  • Check the terminal where the server is running for error messages.
  • Verify your internet connection (required for Mistral Cloud).
  • Make sure env.txt has the correct LLM_PROVIDER value (mistral or ollama).
  • If using Ollama, make sure it is running: open a new terminal and run ollama serve.

"Module not found" or dependency errors

The Python dependencies were not installed correctly.

  • Delete the venv folder inside the tommi_lite directory.
  • Run the start script again — it will recreate the virtual environment and reinstall all dependencies.
Still stuck? Ask for help during the BIP sessions or contact the organisers. Include the error message from your terminal — it will help us diagnose the problem faster.