Skip to content

Repositories to test and play with AI-related training

License

Notifications You must be signed in to change notification settings

mellman99/ai-training-jc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Playground and training helpers

Join me in learning hands-on methods for building actual AI systems, integrating local Small Language Models, building AI Agents, and integrating with larger cloud-hosted Large Language Models. Code is presented to help maximize reuse - so that you can either learn the concepts, or use them within your own applications and systems.

Welcome to the AI mini "courses"!

All of these examples are living documents of AI techniques - updated so that you can follow along, run code and apps yourself (without having to install software onto your machine), and learn the details of how to employ AI solutions in real world software. Most are taken from other good notebooks and examples, then tweaked or repaired as code evolves. All credit should go to the original thinkers.

Python Notebooks that show example code

All the items that start with Notebook are Python Notebooks that can either be run in Google Colab or locally (either by setting up Notebooks locally or copying the Python directly into a local file). If you run them on Google Colab, you need a google colab account (free). When you run a notebook in colab, it spawns a server in the cloud and usually assigns GPU time to that server. If you use it heavily, you might need to load $10 or so into your Colab account to pay for more server time, but that shouldn't be necessary if you are just running these modules.

Click the Open in Colab button to load into the cloud Press the play triangle in each block to run the code within
Alternatively, you can install these Notebooks and run them locally - see instructions here.

Using Huggingface Spaces

HuggingFace is a place to share and research AI models, with a focus on Small Language Models. If you get a free account, you can launch many of the models to test with in "Spaces." Run spaces as cloud servers

Code Notebook Demos/Courses

Thumbnail Notebook 1: Exploring Small Models Point to a very small (250Mb) model and perform basic queries and AI language tricks on it (like sentence classification or translation).
Thumbnail Notebook 2: Ollama and Pydantic Set up a local SLM (or a few of them) using ollama, then use the Pydantic python framework to access it.
Thumbnail Notebook 3: Querying OpenAI remotely Send queries to OpenAI through python, receive 'structured' responses (to use in apps)
Requires: OpenAI API Key (not pro account)
Thumbnail Notebook 4: Simple AI agents Use the smolagents framework using a SLM to run simple AI agents that write code, create images, and build graphs.
Thumbnail Notebook 5: Exploring the Mistral SLM Send queries to the highly performant Mistral Small, and test it on common math questions
Requires: MISTRAL API Key
Thumbnail Notebook 6: Retrieval-augmented generation (RAG) Extract the contents from PDFs, add those to a knowledge graph, then use OpenAI to use that knowledge when answering prompts
Requires OpenAI API Key
Thumbnail Notebook 7: More efficient RAG Use Matryoshka Embeddings to encode knowledge at different levels of complexity, making retrieval faster and a bit better
Requires: OpenAI API Key and Hugging Face Token
Thumbnail Notebook 8: AI Agents that negotiate with each other Use CrewAI with LLaMa 3 running locally (via ollama) to have 4 agents that do research, then negotiate with each other to write a document
Thumbnail Notebook 9: AI Agents that search, RAG, and remember Use CrewAI with OpenAI and a News service to lookup data, store it in a knowledge graph, then answer results
Requires: OpenAI API Key and newsapi.org Key
Thumbnail Notebook 10: Use a custom company model Use LangGraph to build a visual agent workflow with a custom company API
Requires: Custom company API Key and run within your company (not via colab)

HuggingFace Space Demos/Courses

Stable Diffusion Image generator:

Llava image analyzer:

Non-transformer based Language model:

Deepseek when asked about drones:

Generate 3D models and textures:

Generate sound file with realistic accents:


License

This project is licensed under the MIT License - see the LICENSE file for details. Widely recognized as one of the most permissive licenses. Allows users to freely use, modify, and distribute the software with minimal restrictions, only requiring that the original copyright notice be included.

About

Repositories to test and play with AI-related training

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 100.0%