Chat Client (stage 5 -- Implementation with AI)

Due: 18 hours before your final review slot

Overview

As you may recall, one of our learning objectives is for you to be able to call out to an AI system as part of an application: that is, not only use AI to build your application, but also use it as part of how it runs.

Learning Objectives

  1. To make sure you know how to use results from an LLM as part of the work within a program.
  2. To make sure you know how to use an LLM that is installed locally on your computer (which offers privacy compared to using models on corporate servers)

Assignment Tasks

Task 1: Install Ollama application and the llama3.2 model on your computer. Note that ollama supports several free (“open weight”) models that you can run entirely on your computer, and that perform fairly well even on modern laptops.

Task 2: Add two features to your chat client. In each one, your code should call out to your local LLM as part of implementing your feature:

  1. Summarizing the prior contents of the thread (up to a limit of 100 messages, say).
  2. Applying icons, styling, emoji, or other decorations to individual messages based on their content.

We are intentionally leaving these descriptions open-ended so that you can exercise your creativity. Have fun with it! Also, exactly what you implement may depend on how fast your machine is (specifically, whether it has any AI-related hardware) and hence how long it takes the llama3.2 model to execute. It's fine to do something that works within the capabilities of your laptop -- our goal is for you to meet the Learning Objectives as best you can.

Note that your client's architecture may need to change to support this. It may have been written in a way that makes it difficult or impossible to call a local agent, and it may require re-architecting to enable it. The good news is that Claude Code is able to generate code for this. The bad news is that it may require a lot of editing, depending on how things were set up initially. We're making this change on purpose: because this is something that does sometimes happen in software development, where a new dependency requires a system to that was not designed for it to adapt to it.