PyCon Nigeria Annual Conference

An Object Oriented Approach for Interfacing with Generative AI

speaker-foto

Tosin Amuda

Tosin is a Full Stack Software Engineer at IBM in the global Innovation Studio team focused on building demo platform and experience for IBM global clients. In his time at IBM, he has received several global recognition including Developer Advocate Hero Award and a MEA CTO Recognition. He is also an avid design thinker who has delivered successful design thinking workshops. Outside of work, Tosin spend his time sharing his knowledge and expertise either through guest lecturing on Cloud & AI Development at universities such as Oxford, Surrey, and Sheffield Hallam or through Industry Mentorship programs like She Code Africa Cloud School Program and GIZ Africa AI Accelerator.

Description

Learn how to effectively leverage object-oriented programming principles to interface with large language models (LLMs). This tutorial will demonstrate how OOP can streamline the interaction process, enhance code maintainability, and empower developers to harness the full potential of LLMs in their projects.

Abstract

Overview

In this tutorial, participants will explore the power of object-oriented programming (OOP) in interfacing with large language models (LLMs). We will begin by providing a brief overview of LLMs. Then, we will delve into the fundamental principles of OOP, including encapsulation, inheritance, and polymorphism, and discuss how these concepts can be applied to facilitate seamless interactions with LLMs.

Through hands-on coding exercises, attendees will learn how to design and implement object-oriented solutions for tasks such as text generation, and entity extraction using LLMs.

By the end of the tutorial, participants will have gained a comprehensive understanding of how OOP can be leveraged to effectively interface with LLMs, resulting in more efficient and maintainable codebases.

Outline (1 hour)

  1. Introduction and Setup (5 Minutes)

  2. Introduction to Large Language Models (LLMs) (5 minutes)

  3. Overview of LLMs and their capabilities

  4. Why Object-Oriented Programming for LLMs (5 minutes)

    • Modularity and code reusability
    • Encapsulation of LLM-specific logic
    • Easier integration with existing codebases
    • Scalability and extensibility
    • Ability to switch between different LLM providers
  5. Designing an LLM Interface using OOP Approach (10 minutes)

    • Designing classes for LLM interaction
    • Encapsulating LLM functionality
    • Leveraging inheritance and polymorphism
  6. Hands-on Coding Exercise (30 minutes)

    • Text generation using LLMs with OOP in Python
  7. Q&A and Additional Discussion (5 minutes)

Prerequisite for participants

  1. Basic understanding of Python programming
  2. Familiarity with Google CoLab (or Kaggle or a local development setup with a Jupyter notebook will also suffix with Python >=3.6, pip3)
  3. Cloudflare Worker AI Account (or any LLM as a Service platform of their choice)
Audience level: Intermediate or Advanced