Hands-on AI Toolkit for classrooms
Project description
HandsOnAI: Your AI Learning Lab
AI learning made simple for students and educators
HandsOnAI is a unified educational toolkit designed to teach students how modern AI systems work โ by building and interacting with them directly.
It provides a clean, modular structure that introduces core AI concepts progressively through three tools:
๐งฑ Module Overview
| Module | Purpose | CLI Name |
|---|---|---|
| chat | Simple chatbot with system prompts | chat |
| rag | Retrieval-Augmented Generation (RAG) | rag |
| agent | ReAct-style reasoning with tool use | agent |
| models | Model capability detection and utilities | models |
Each module is:
- ๐ Self-contained
- ๐งฉ Installable via one package:
pip install hands-on-ai - ๐ง Designed for progressive learning
๐ Project Structure
hands_on_ai/
โโโ chat/ โ A simple prompt/response chatbot
โโโ rag/ โ Ask questions using your own documents
โโโ agent/ โ Agent reasoning + tools (ReAct-style)
โโโ config.py โ Shared config (model, chunk size, paths)
โโโ cli.py โ Meta CLI (list, config, version)
โโโ models.py โ Centralized model utilities
โโโ utils/ โ Shared tools, prompts, paths, etc.
โโโ commands/ โ Shared CLI commands
Examples and scripts are available in the repository:
hands-on-ai/
โโโ examples/ โ Example scripts for all modules
โโโ scripts/ โ Utility scripts for package maintenance
๐งโ๐ซ Why This Matters for Students
Each tool teaches a different level of modern AI interaction:
- chat โ Prompt engineering, roles, and LLMs
- rag โ Document search, embeddings, and grounded answers
- agent โ Multi-step reasoning, tool use, and planning
๐ Getting Started
Installation
# Install from PyPI
pip install hands-on-ai
# Or directly from GitHub
pip install git+https://github.com/teaching-repositories/hands-on-ai.git
Prerequisites
- Python 3.6 or higher
- Any OpenAI-compatible LLM provider (see Provider Compatibility)
Quick Start
Option 1: Set configuration in Python (Recommended for beginners)
import os
# Configure your provider
os.environ['HANDS_ON_AI_SERVER'] = 'https://ollama.serveur.au'
os.environ['HANDS_ON_AI_MODEL'] = 'llama3.2'
os.environ['HANDS_ON_AI_API_KEY'] = input('Enter your API key: ')
# Now use HandsOnAI
from hands_on_ai.chat import pirate_bot
print(pirate_bot("What is photosynthesis?"))
Option 2: Use environment variables
Run a local Ollama server, then set environment variables and start chatting:
export HANDS_ON_AI_SERVER="http://localhost:11434"
# No API key needed for local Ollama
from hands_on_ai.chat import pirate_bot
print(pirate_bot("What is photosynthesis?"))
For more options:
from hands_on_ai.chat import get_response, friendly_bot, pirate_bot
# Basic usage with default model
response = get_response("Tell me about planets")
print(response)
# Use a personality bot
pirate_response = pirate_bot("Tell me about sailing ships")
print(pirate_response)
๐ Provider-Agnostic Architecture
HandsOnAI is designed to work with any OpenAI-compatible LLM provider. The system uses standard OpenAI API endpoints (/v1/chat/completions, /v1/models) making it compatible with a wide range of AI services.
Configuration
Set your provider using environment variables:
# Set your provider's base URL
export HANDS_ON_AI_SERVER="https://your-provider-url"
# Set API key if required
export HANDS_ON_AI_API_KEY="your-api-key"
# Enable debug logging
export HANDS_ON_AI_LOG="debug"
Provider Examples
Ollama (Local)
export HANDS_ON_AI_SERVER="http://localhost:11434"
# No API key needed for local Ollama
OpenAI
export HANDS_ON_AI_SERVER="https://api.openai.com"
export HANDS_ON_AI_API_KEY="sk-your-openai-key"
Together AI
export HANDS_ON_AI_SERVER="https://api.together.xyz"
export HANDS_ON_AI_API_KEY="your-together-key"
OpenRouter
export HANDS_ON_AI_SERVER="https://openrouter.ai/api"
export HANDS_ON_AI_API_KEY="your-openrouter-key"
export HANDS_ON_AI_MODEL="openai/gpt-4o" # or any model they support
LocalAI
export HANDS_ON_AI_SERVER="http://localhost:8080"
# API key optional depending on setup
๐ Provider Compatibility
HandsOnAI works with any service that implements OpenAI-compatible endpoints:
| Provider | Base URL Example | Authentication | Status |
|---|---|---|---|
| Ollama | http://localhost:11434 |
None (local) | โ Tested |
| OpenAI | https://api.openai.com |
Bearer token | โ Compatible |
| OpenRouter | https://openrouter.ai/api |
Bearer token | โ Compatible |
| Together AI | https://api.together.xyz |
Bearer token | โ Compatible |
| LocalAI | http://localhost:8080 |
Optional | โ Compatible |
| vLLM | http://your-vllm-server |
Optional | โ Compatible |
| Groq | https://api.groq.com |
Bearer token | โ Compatible |
| Hugging Face | https://api-inference.huggingface.co |
Bearer token | โ Compatible |
| Any OpenAI-compatible server | http://your-server |
Varies | โ Compatible |
Requirements for Compatibility
Your provider must support:
- โ
/v1/chat/completionsendpoint - โ
/v1/modelsendpoint - โ
OpenAI message format (
{"role": "user", "content": "..."}) - โ Bearer token authentication (if API key required)
Educational Benefits
This provider-agnostic approach offers several educational advantages:
- ๐ No vendor lock-in - Switch providers without code changes
- ๐ Industry standards - Students learn OpenAI API patterns used across the industry
- ๐ง Real-world skills - Transferable knowledge to other AI tools and platforms
- ๐ก Flexibility - Use local models for privacy or cloud models for power
Contributing
We welcome contributions! See CONTRIBUTING.md for guidelines on how to get involved.
License
This project is licensed under the MIT License - see the LICENSE file for details.
LLM Ready
This package is LLM-ready with a comprehensive guide for Large Language Models to understand its functionality. See the LLM Guide for detailed API references, usage examples, and best practices.
For best results when working with an LLM:
- Download the LLM guide file
- Upload it to your LLM interface/chat at the beginning of your conversation
- The LLM will now have detailed knowledge about the package's structure and capabilities
Acknowledgments
- Built with education in mind
- Powered by open-source LLM technology
- Inspired by educators who want to bring AI into the classroom responsibly
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hands_on_ai-0.2.0.tar.gz.
File metadata
- Download URL: hands_on_ai-0.2.0.tar.gz
- Upload date:
- Size: 120.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa6c298399508b18034587c6233f5ab83bd5be1f7ef8f4f1602428ee33140040
|
|
| MD5 |
85e7da34bfecbfbff648c862466318dc
|
|
| BLAKE2b-256 |
1029ac6a1d494bc44893b98fb18b784840e1608d3977f375273893bd6af7ef02
|
File details
Details for the file hands_on_ai-0.2.0-py3-none-any.whl.
File metadata
- Download URL: hands_on_ai-0.2.0-py3-none-any.whl
- Upload date:
- Size: 143.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21175545e7e84869c8ca2d21a41d831b347a7483b44933a7cd178e1fa97c930d
|
|
| MD5 |
5ee7bde46891cb523a021a631e77971d
|
|
| BLAKE2b-256 |
1cd0a679cb2bbafafdc514d8a4e19b4af26fa3c935bd9f57e368e0e37edba682
|