Skip to content

ccozad/ml-reference-designs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This repo contains a set of reference designs for various ML topics. A few examples of the types of things you can learn here:

Contents

Broswer Use [FEATURED]

Browser Use is an open source library that allows language models to interact with browser windows and page contents

Browser Use Demo - Gather Car Prices

Agents [FEATURED]

An Agent is a system that leverages an AI model to interact with its environment in order to achieve a user-defined objective. It combines reasoning, planning, and the execution of actions (often via external tools) to fulfill tasks.

  • Overview
  • Dummy Agent A bare bones agent with mocked tool calls
  • Smol Agent A template for using the SmolAgent framework with a Gradio web interface
  • Code Agents Use the SmolAgent framework to create agents that generate code to call tools and perform calculations.
    • Duration Agent Generate code that uses authorized imports to add up the times listed in the prompt.
    • Menu Agent Call a custom tool to generate a menu prompt and populate using the model's built in knowledge
    • Playlist Agent Search the internet and generate a music playlist for a wedding
  • Workout Agents Use the SmolAgent framework to perform fitness related planning tasks
    • Strength Plan Agent An agent that considers how many reps you can do at a given weight and generates a strength training program
  • Retrieval Agents Retrieve data from specialized systems using the SmolAgent framework.
  • Multi-agents Multiple agents working together
    • Park Planner Multi-Agent Search the internet for national parks and calculate travel time by cargo plane. One agent can search the internet and the other agent does planning and distance calculations
  • Travel Agents Use LangGraph to work with natural language to work with flight reservations and look up company travel policies
  • Audio Agent Use OpenAI Agents library to process voice data with multi-agent pipelines.

Debug AI Agent Execution using the Trace feature OpenAI Trace Example

Leverage agents that use a large language model as the brain to direct tools that interact with the real world. AI Agent

Getting Started

Various simple examples for getting started with different frameworks

Feature Engineering

Various recipes for common feature engineering tasks.

Image Processing

Recipes for working with images

Increase the effectiveness of OCR by preprocessing images Adaptive threshold

Regression

Various examples that deal with predicting a value based on inputs

Classification

Various examples that deal with placing inputs into one or more categories

Clustering

Various examples that deal with grouping data points by a similarity metric.

Group items that are similar using only their attributes K-means clustering for seeds

Time Series

Various examples that deal with time based data

Predict future values in data that varies over time Time Series Prediction

Computer Vision

Various examples that deal with processing image data.

Intelligently select complex objects in images Segmented Image

Large Language Models

Examples that interact with large language models with billions of parameters that are often training across many commercial grade GPUs for many millions of hours.

Claude 3.5

LangChain

Direct a large language model to answer based only on context from documents RAG Pipeline

LangGraph

Form graphs to model decisions and loops with AI Positive Sentiment Trace

Llama 3

Llama Index

Small Language Models

Phi-3

Deployment

Various tasks that deal with deploying AI systems

Dotnet MCP Server

Further Reading

Setup

Jupyter requirement

Some of the examples in this repo are meant to be run interactively using Jupyter-Lab or Jupiter-Notebooks. See https://jupyter.org/install

Examples that only have script files will have a README file with instructions.

Python Virtual environment

To avoid conflicts with your local environment, create a virtual environment and run the notebook within this environment.

Selecting the new kernel

Then select the virtualenv kernel after launching Jupyter Lab with the command jupyter lab

Additional resources

For additional background see https://www.linkedin.com/pulse/how-use-virtual-environment-inside-jupyter-lab-sina-khoshgoftar

Windows

python -m venv .venv
.venv\Scripts\activate
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
pip install -r requirements.txt
python -m ipykernel install --user --name=virtualenv

Most advances in machine learning are happening on Linux targeting Nvidia GPUs with CUDA support. Some advanced models such as Llama 3 may not work well (or at all) on Windows machines.

JavaScript environment

Some examples are targeted at NodeJS. There are no specific versions of Node needed but you can always use nvm to keep your environments tidy. See https://github.com/nvm-sh/nvm for more details.

Working with LLMs

Workbook examples that include LLMs models are more complex than other examples and require additional setup work.

Llama 3

Industry domain problems

Examples in this repo cover the following industry domain problems:

  • Accounting
    • Receipt processing
  • Botany
    • Group observations into n groups based on equal variance
  • Customer Service
    • Context aware chat bots
  • Event Planning
    • Generate music playlists
    • Generate menus for specific occasions
    • Calculate the total time needed for setup
  • Fitness
    • Generate a strength training program
  • Games
    • AI controlled NPCs
  • Hospitality
    • Sentiment analysis
  • Medical
    • Breast cancer diagnosis
  • Real Estate
    • Price prediction
  • Retail
    • Product image classification
  • Technology
    • Deploy machine learning models to production
    • Compose workflows involving large language models (LLMs)
    • Store and search for embedding data in vector stores
    • Intelligently select complex objects in images
    • Expand capabilities of large language models with custom tool calling
    • Create AI agents that can interact with the real world
  • Transportation
    • Seasonal airline traffic prediction
    • Search the internet for locations, calculate travel times to all destinations
    • Manage flights
  • Zoology
    • Group observations based on data density

Releases

No releases published

Packages

No packages published

Languages