🤖

AI & GenAI

Production-ready snippets for LLMs, embeddings, RAG pipelines, and AI integrations.

204 snippets

Showing 204 of 204 snippets

typescriptintermediate

OpenAI Chat Completion with Streaming

Stream GPT responses token-by-token using the OpenAI SDK with async iteration.

Best for: chatbot UI

#openai#streaming
typescriptbeginner

Generate Text Embeddings with OpenAI

Create vector embeddings for semantic search and similarity matching using text-embedding-3-small.

Best for: semantic search

#openai#embeddings
typescriptadvanced

RAG Pipeline (Retrieve + Augment + Generate)

Minimal RAG implementation: embed a query, retrieve top-k chunks, inject into prompt.

Best for: document Q&A

#rag#embeddings
typescriptbeginner

Claude Messages API (Anthropic SDK)

Send messages to Claude using the official Anthropic SDK with system prompt and user turn.

Best for: AI assistant

#anthropic#claude
typescriptintermediate

OpenAI Tool Calling (Function Calling)

Define tools for GPT to call, parse the response, execute the function, and return results.

Best for: AI agents

#openai#tool-calling
pythonbeginner

LangChain Prompt Chain (Python)

Build a simple LLMChain with a prompt template and ChatOpenAI in LangChain.

Best for: prompt chaining

#langchain#openai
typescriptbeginner

DALL·E 3 Image Generation

Generate images from a text prompt using the OpenAI DALL·E 3 API and return a URL.

Best for: AI art generation

#openai#dall-e
typescriptintermediate

OpenAI Structured Output with Zod

Force GPT-4o to return valid JSON matching a Zod schema using response_format structured output.

Best for: data extraction

#openai#zod
typescriptbeginner

Content Moderation with OpenAI

Check user input for harmful content using the OpenAI Moderation API before processing.

Best for: user input safety

#openai#moderation
typescriptintermediate

Next.js AI Streaming Route Handler

Stream OpenAI responses from a Next.js App Router route handler using the Vercel AI SDK.

Best for: AI chatbot backend

#nextjs#openai
typescriptadvanced

LangChain RAG Chain Pipeline

Build a retrieval-augmented generation chain with LangChain using vector store retrieval and prompt templates.

Best for: Document Q&A

#langchain#rag
typescriptintermediate

OpenAI Assistants API with Threads

Create persistent conversation threads with OpenAI Assistants API for stateful multi-turn interactions.

Best for: Customer support bots

#openai#assistants
typescriptintermediate

Pinecone Vector Store Operations

Store and query vector embeddings with Pinecone for semantic search and similarity matching.

Best for: Semantic search engines

#pinecone#vector-store
typescriptbeginner

Few-Shot Prompt Template

Build structured few-shot prompts with examples, system instructions, and output format constraints.

Best for: Consistent AI outputs

#prompts#few-shot
typescriptadvanced

AI Agent Loop with Tool Calling

Implement an autonomous agent loop that plans, selects tools, executes actions, and observes results.

Best for: Research assistants

#agents#tool-calling
pythonbeginner

Token Counter with Tiktoken

Count tokens and estimate costs for OpenAI API calls using the tiktoken tokenizer library.

Best for: Cost estimation

#tokens#tiktoken
pythonintermediate

Hugging Face Inference API

Run ML models via the Hugging Face Inference API for text generation, classification, and embeddings.

Best for: Text classification

#huggingface#inference
typescriptintermediate

Whisper Audio Transcription

Transcribe audio files to text using OpenAI Whisper API with language detection and timestamps.

Best for: Podcast transcription

#whisper#transcription
typescriptbeginner

OpenAI Text-to-Speech

Generate natural speech audio from text using OpenAI TTS API with multiple voice options and formats.

Best for: Audiobook generation

#tts#speech
typescriptadvanced

AI Guardrails & Safety Pattern

Implement input/output guardrails for LLM applications with content filtering and response validation.

Best for: User-facing chatbots

#guardrails#safety
typescriptintermediate

Google Gemini API Integration

Call the Google Gemini API for text generation with streaming, safety settings, and system prompts.

Best for: Google AI-powered code generation

#gemini#google-ai
typescriptintermediate

Cosine Similarity for Embeddings

Compute cosine similarity between embedding vectors for semantic search and recommendation systems.

Best for: Semantic search over documents

#embeddings#similarity
typescriptintermediate

LLM JSON Output Parser

Parse and validate JSON responses from LLMs with retry logic and schema enforcement using Zod.

Best for: Extracting structured data from LLM responses

#llm#json-parsing
typescriptadvanced

AI Chat Conversation Memory

Manage conversation history with token limits, summarization, and sliding window for LLM chat apps.

Best for: Building chatbot applications with context

#chat#memory
typescriptadvanced

AI Prompt Chaining Pattern

Chain multiple LLM calls sequentially where each step's output feeds into the next for complex tasks.

Best for: Complex multi-step AI workflows

#prompt-engineering#chaining
typescriptadvanced

Semantic Caching Layer for LLM Calls

Cache LLM responses by semantic similarity of prompts to reduce API costs and improve latency.

Best for: Reducing LLM API costs for repeated queries

#caching#embeddings
typescriptintermediate

AI Text Classification with Prompts

Classify text into categories using structured prompting with confidence scores and explanations.

Best for: Automated support ticket routing

#classification#prompt-engineering
typescriptintermediate

Batch Embeddings Processing

Generate embeddings for large document sets in batches with rate limiting and progress tracking.

Best for: Indexing large document collections for search

#embeddings#batch-processing
typescriptadvanced

AI Model Router for Cost Optimization

Route prompts to different LLM models based on complexity to optimize cost and response quality.

Best for: Reducing AI API costs for production apps

#routing#optimization
typescriptadvanced

RAG Pipeline Implementation

Build a retrieval-augmented generation pipeline that grounds LLM answers in your own documents.

Best for: Grounding LLM answers in private documents

#ai#rag
pythonadvanced

Build a RAG Pipeline with LangChain

Implement retrieval-augmented generation using LangChain, embeddings, and a vector store.

Best for: Knowledge base Q&A

#ai#langchain
pythonintermediate

OpenAI Structured Output with Pydantic

Force GPT to return validated JSON matching a Pydantic schema.

Best for: Review analysis

#ai#openai
pythonbeginner

Prompt Template Engineering Patterns

Design reusable, parameterized prompt templates for consistent LLM outputs.

Best for: Consistent LLM outputs

#ai#prompt-engineering
pythonintermediate

Semantic Similarity Search with Embeddings

Compute and compare text embeddings for semantic search and matching.

Best for: Semantic search

#ai#embeddings
pythonintermediate

Text Classification with Hugging Face

Fine-tune or use pre-trained Hugging Face models for text classification.

Best for: Sentiment analysis

#ai#huggingface
pythonintermediate

OpenAI Function Calling / Tool Use

Let GPT call your functions by defining tool schemas and handling responses.

Best for: AI agents

#ai#openai
pythonbeginner

Stream LLM Chat Responses

Stream OpenAI chat completions token-by-token for real-time UI updates.

Best for: Chat UIs

#ai#streaming
pythonbeginner

Token Counting and Cost Estimation

Count tokens accurately and estimate API costs before making LLM calls.

Best for: Budget management

#ai#tokens
pythonintermediate

Analyze Images with GPT Vision API

Send images to GPT-4o for description, analysis, and visual Q&A.

Best for: Image analysis

#ai#vision
pythonadvanced

Build a ReAct Agent Loop

Implement a reasoning-action loop for an AI agent that uses tools iteratively.

Best for: AI agents

#ai#agent
pythonadvanced

Output Guardrails for LLM Responses

Validate and sanitize LLM outputs to prevent hallucination and injection.

Best for: Safety filtering

#ai#guardrails
pythonintermediate

Batch Process Embeddings Efficiently

Process large datasets of embeddings with batching, caching, and rate limiting.

Best for: Large-scale indexing

#ai#embeddings
pythonadvanced

Prepare a Fine-Tuning Dataset for OpenAI

Format, validate, and upload training data for OpenAI model fine-tuning.

Best for: Model customization

#ai#fine-tuning
pythonintermediate

LangChain Conversation with Memory

Maintain conversation context across turns using LangChain memory modules.

Best for: Multi-turn chatbots

#ai#langchain
typescriptintermediate

Ollama Local LLM Inference

Run local LLM inference using Ollama REST API with streaming and model management.

Best for: local development

#ai#ollama
pythonintermediate

ChromaDB Vector Database Operations

Store and query vector embeddings using ChromaDB for semantic search and RAG applications.

Best for: semantic search

#ai#chromadb
typescriptadvanced

LLM Output Evaluation and Scoring

Evaluate LLM outputs programmatically with scoring rubrics for quality, relevance, and safety.

Best for: prompt testing

#ai#evaluation
typescriptintermediate

Text Chunking Strategies for RAG

Implement different text chunking strategies for RAG pipelines — fixed, recursive, and semantic.

Best for: RAG pipeline preprocessing

#ai#chunking
typescriptintermediate

OpenAI Vision API Image Analysis

Analyze images using GPT-4o vision capabilities with base64 and URL inputs.

Best for: image captioning

#ai#vision
typescriptadvanced

Anthropic Claude Tool Use Pattern

Implement tool/function calling with Claude using the Anthropic SDK for agentic workflows.

Best for: agentic workflows

#ai#anthropic
typescriptbeginner

Transformer Architecture

AI/ML technique: transformer-architecture

Best for: machine learning

#ai#machine-learning
typescriptintermediate

Bert Embeddings

AI/ML technique: bert-embeddings

Best for: machine learning

#ai#machine-learning
typescriptadvanced

Gpt Fine Tuning

AI/ML technique: gpt-fine-tuning

Best for: machine learning

#ai#machine-learning
typescriptbeginner

Llama Models

AI/ML technique: llama-models

Best for: machine learning

#ai#machine-learning
typescriptintermediate

Attention Mechanism

AI/ML technique: attention-mechanism

Best for: machine learning

#ai#machine-learning
typescriptadvanced

Self Attention

AI/ML technique: self-attention

Best for: machine learning

#ai#machine-learning
typescriptbeginner

Multi Head Attention

AI/ML technique: multi-head-attention

Best for: machine learning

#ai#machine-learning
typescriptintermediate

Cross Attention

AI/ML technique: cross-attention

Best for: machine learning

#ai#machine-learning
typescriptadvanced

Positional Encoding

AI/ML technique: positional-encoding

Best for: machine learning

#ai#machine-learning
typescriptbeginner

Rotary Embeddings

AI/ML technique: rotary-embeddings

Best for: machine learning

#ai#machine-learning
typescriptintermediate

Tokenization Advanced

AI/ML technique: tokenization-advanced

Best for: machine learning

#ai#machine-learning
typescriptadvanced

Bpe Tokenizer

AI/ML technique: bpe-tokenizer

Best for: machine learning

#ai#machine-learning
typescriptbeginner

Text Classification

AI/ML technique: text-classification

Best for: machine learning

#ai#machine-learning
typescriptintermediate

Sentiment Analysis

AI/ML technique: sentiment-analysis

Best for: machine learning

#ai#machine-learning
typescriptadvanced

Named Entity Recognition

AI/ML technique: named-entity-recognition

Best for: machine learning

#ai#machine-learning
typescriptbeginner

Semantic Similarity

AI/ML technique: semantic-similarity

Best for: machine learning

#ai#machine-learning
typescriptintermediate

Clustering Embeddings

AI/ML technique: clustering-embeddings

Best for: machine learning

#ai#machine-learning
typescriptadvanced

Semantic Search Advanced

AI/ML technique: semantic-search-advanced

Best for: machine learning

#ai#machine-learning
typescriptbeginner

Reranking Models

AI/ML technique: reranking-models

Best for: machine learning

#ai#machine-learning
typescriptintermediate

Retrieval Ranking

AI/ML technique: retrieval-ranking

Best for: machine learning

#ai#machine-learning
typescriptadvanced

Knowledge Graphs

AI/ML technique: knowledge-graphs

Best for: machine learning

#ai#machine-learning
typescriptbeginner

Ontology Design

AI/ML technique: ontology-design

Best for: machine learning

#ai#machine-learning
typescriptintermediate

Entity Linking

AI/ML technique: entity-linking

Best for: machine learning

#ai#machine-learning
typescriptadvanced

Relation Extraction

AI/ML technique: relation-extraction

Best for: machine learning

#ai#machine-learning
typescriptbeginner

Question Answering System

AI/ML technique: question-answering-system

Best for: machine learning

#ai#machine-learning
typescriptintermediate

Open Domain Qa

AI/ML technique: open-domain-qa

Best for: machine learning

#ai#machine-learning
typescriptadvanced

Reading Comprehension

AI/ML technique: reading-comprehension

Best for: machine learning

#ai#machine-learning
typescriptbeginner

Multi Hop Reasoning

AI/ML technique: multi-hop-reasoning

Best for: machine learning

#ai#machine-learning
typescriptintermediate

Machine Translation

AI/ML technique: machine-translation

Best for: machine learning

#ai#machine-learning
typescriptadvanced

Transliteration

AI/ML technique: transliteration

Best for: machine learning

#ai#machine-learning
typescriptbeginner

Code Generation

AI/ML technique: code-generation

Best for: machine learning

#ai#machine-learning
typescriptintermediate

Text To Code

AI/ML technique: text-to-code

Best for: machine learning

#ai#machine-learning
typescriptadvanced

Image Captioning

AI/ML technique: image-captioning

Best for: machine learning

#ai#machine-learning
typescriptbeginner

Visual Qa

AI/ML technique: visual-qa

Best for: machine learning

#ai#machine-learning
typescriptintermediate

Object Detection Models

AI/ML technique: object-detection-models

Best for: machine learning

#ai#machine-learning
typescriptadvanced

Segmentation Models

AI/ML technique: segmentation-models

Best for: machine learning

#ai#machine-learning
typescriptbeginner

Diffusion Models

AI/ML technique: diffusion-models

Best for: machine learning

#ai#machine-learning
typescriptintermediate

Vae Variational

AI/ML technique: vae-variational

Best for: machine learning

#ai#machine-learning
typescriptadvanced

Gan Generative

AI/ML technique: gan-generative

Best for: machine learning

#ai#machine-learning
typescriptbeginner

Flow Models

AI/ML technique: flow-models

Best for: machine learning

#ai#machine-learning
typescriptintermediate

Reinforcement Learning

AI/ML technique: reinforcement-learning

Best for: machine learning

#ai#machine-learning
typescriptadvanced

Policy Gradient

AI/ML technique: policy-gradient

Best for: machine learning

#ai#machine-learning
typescriptbeginner

Q Learning

AI/ML technique: q-learning

Best for: machine learning

#ai#machine-learning
typescriptintermediate

Actor Critic

AI/ML technique: actor-critic

Best for: machine learning

#ai#machine-learning
typescriptadvanced

Prompt Engineering

AI/ML technique: prompt-engineering

Best for: machine learning

#ai#machine-learning
typescriptbeginner

Rag Evaluation

AI/ML technique: rag-evaluation

Best for: machine learning

#ai#machine-learning
typescriptintermediate

Model Distillation

AI/ML technique: model-distillation

Best for: machine learning

#ai#machine-learning
typescriptadvanced

Model Quantization

AI/ML technique: model-quantization

Best for: machine learning

#ai#machine-learning
typescriptbeginner

Lora Finetuning

AI/ML technique: lora-finetuning

Best for: machine learning

#ai#machine-learning
typescriptintermediate

Vector Database Indexing

AI/ML technique: vector-database-indexing

Best for: machine learning

#ai#machine-learning
pythonintermediate

Async OpenAI Client in Python

Use the AsyncOpenAI client with asyncio to run concurrent chat completions without blocking.

Best for: concurrent LLM calls

#openai#async
pythonintermediate

LangChain Tool-Using Agent

Build a LangChain agent with custom tools for web search, calculator, and Python REPL.

Best for: AI agents

#langchain#agent
pythonadvanced

RAG with FAISS and LangChain Python

Build a local RAG pipeline using FAISS vector store and LangChain for document Q&A.

Best for: document Q&A

#rag#faiss
pythonbeginner

Anthropic Streaming with Python

Stream Claude responses token by token using the Anthropic Python SDK with context manager.

Best for: streaming responses

#anthropic#claude
pythonbeginner

Sentence Transformers Local Embeddings

Generate high-quality text embeddings locally using Sentence Transformers without API calls.

Best for: semantic search

#sentence-transformers#embeddings
pythonintermediate

Structured LLM Output with Pydantic

Parse LLM responses into validated Pydantic models using LangChain's structured output binding.

Best for: structured extraction

#langchain#pydantic
pythonintermediate

ChromaDB Persistent Vector Store

Create, persist, and query a ChromaDB vector store for semantic document retrieval.

Best for: local vector DB

#chromadb#vector-db
pythonadvanced

OpenAI Batch API for Cost Reduction

Submit large workloads via the OpenAI Batch API for 50% cost reduction with async processing.

Best for: batch inference

#openai#batch
pythonbeginner

Google Gemini Vision API in Python

Analyse images and PDFs using Google Gemini's multimodal vision API with the Python SDK.

Best for: image analysis

#gemini#vision
pythonintermediate

LlamaIndex Document Query Engine

Index and query documents with LlamaIndex's VectorStoreIndex for fast semantic search.

Best for: document RAG

#llamaindex#rag
pythonbeginner

Mistral AI API Client in Python

Make chat and embedding requests to Mistral AI using the official Python SDK.

Best for: European AI compliance

#mistral#llm
pythonadvanced

Prepare Fine-Tuning Dataset for OpenAI

Build, validate, and upload a JSONL fine-tuning dataset for OpenAI GPT fine-tuning.

Best for: model customization

#openai#fine-tuning
pythonintermediate

Cosine Similarity Semantic Search in Python

Implement semantic search with NumPy cosine similarity over OpenAI embeddings.

Best for: semantic search

#embeddings#cosine-similarity
pythonintermediate

LangChain Conversation with Memory

Build a stateful chatbot that remembers conversation history using LangChain memory.

Best for: stateful chatbots

#langchain#memory
pythonbeginner

Whisper Audio Transcription Pipeline

Transcribe audio files to text using OpenAI Whisper API with language detection and timestamps.

Best for: meeting transcription

#whisper#transcription
pythonbeginner

OpenAI DALL-E Image Generation

Generate and save images using the DALL-E 3 API with quality and style control.

Best for: AI image creation

#openai#dall-e
pythonintermediate

LLM Retry with Model Fallback

Add resilient retry logic with exponential backoff and automatic model fallback for LLM calls.

Best for: production resilience

#openai#retry
pythonintermediate

Cohere Reranker for RAG Precision

Improve RAG retrieval quality by reranking candidate documents with Cohere's rerank API.

Best for: RAG precision improvement

#cohere#reranking
pythonadvanced

LangChain SQL Database Agent

Create an AI agent that answers natural language questions by querying a SQL database.

Best for: NL2SQL

#langchain#sql
pythonbeginner

Jinja2 Prompt Templates for AI

Manage complex AI prompt templates with Jinja2 for reusable, parameterised prompt generation.

Best for: prompt management

#jinja2#prompts
pythonbeginner

LangChain Recursive Text Splitter

Split long documents into overlapping chunks optimised for LLM context windows.

Best for: PDF ingestion

#langchain#text-splitting
pythonintermediate

Weaviate Vector Store in Python

Store, index, and perform semantic search on documents using the Weaviate Python client.

Best for: semantic search

#weaviate#vector-db
pythonbeginner

OpenAI Content Moderation API

Screen user-generated content for policy violations using the OpenAI moderation endpoint.

Best for: content safety

#openai#moderation
pythonintermediate

LangChain Few-Shot Prompt Examples

Improve LLM accuracy with dynamic few-shot examples selected by semantic similarity.

Best for: few-shot learning

#langchain#few-shot
pythonintermediate

Qdrant Vector Database Client

Index and search high-dimensional embeddings with the Qdrant Python client.

Best for: vector similarity search

#qdrant#vector-db
pythonintermediate

Structured AI Extraction with Instructor

Use the Instructor library to extract validated Pydantic models from LLM responses reliably.

Best for: information extraction

#instructor#pydantic
pythonadvanced

OpenAI Realtime API WebSocket

Connect to the OpenAI Realtime API via WebSocket for low-latency voice and text streaming.

Best for: voice AI

#openai#realtime
pythonbeginner

Hugging Face Transformers Pipeline

Run text classification, NER, summarisation, and translation tasks with the HF Pipelines API.

Best for: NLP tasks

#huggingface#transformers
pythonadvanced

OpenAI Assistants API with File Search

Create a persistent AI assistant with file search capability using the Assistants API v2.

Best for: document Q&A

#openai#assistants
pythonbeginner

Token Counting with tiktoken

Count tokens, split text by token limits, and estimate API costs using the tiktoken library.

Best for: cost estimation

#tiktoken#tokens
pythonintermediate

LangChain Output Parser for Code

Parse AI-generated code blocks with LangChain's custom output parsers to extract clean code.

Best for: code extraction

#langchain#output-parser
pythonadvanced

Semantic Kernel Plugin in Python

Build a Semantic Kernel plugin with kernel functions that can be invoked by an AI planner.

Best for: AI orchestration

#semantic-kernel#plugin
pythonbeginner

OpenAI JSON Mode Responses

Force JSON output from OpenAI models using response_format for reliable structured responses.

Best for: structured AI responses

#openai#json-mode
pythonintermediate

Cache Embeddings in Redis

Cache expensive embedding API calls in Redis to avoid redundant computation and reduce costs.

Best for: cost reduction

#redis#embeddings
pythonadvanced

LangChain ReAct Agent Pattern

Implement a ReAct (Reason+Act) agent that thinks step-by-step before calling tools.

Best for: reasoning agents

#langchain#react
pythonadvanced

NeMo Guardrails for Safe LLM

Apply NVIDIA NeMo Guardrails to enforce topic boundaries and prevent prompt injection in LLM apps.

Best for: LLM safety

#nemo#guardrails
pythonbeginner

OpenAI GPT-4 Vision Image Analysis

Analyse images from URLs or base64 with GPT-4 Vision for structured visual understanding.

Best for: visual Q&A

#openai#vision
pythonbeginner

Local LLM with Ollama Python Client

Run local open-source models with Ollama and stream responses using the Python API.

Best for: local AI

#ollama#local-llm
pythonadvanced

DSPy Chain-of-Thought Module

Use DSPy to programmatically build and optimise chain-of-thought reasoning pipelines.

Best for: systematic reasoning

#dspy#chain-of-thought
pythonbeginner

Zero-Shot Text Classification

Classify text into custom categories using zero-shot NLI models without training data.

Best for: content categorization

#huggingface#zero-shot
pythonintermediate

LangChain create_sql_query_chain

Generate SQL from natural language using LangChain's create_sql_query_chain with schema awareness.

Best for: NL to SQL

#langchain#nl2sql
pythonintermediate

OpenAI Streaming with SSE in FastAPI

Stream OpenAI responses as Server-Sent Events from a FastAPI endpoint.

Best for: streaming AI APIs

#openai#fastapi
pythonintermediate

LangChain Sequential Multi-Step Chain

Build a multi-step reasoning pipeline where each step's output feeds into the next chain.

Best for: multi-step AI pipelines

#langchain#sequential
pythonadvanced

Haystack Question Answering Pipeline

Build a document retrieval and Q&A pipeline using Haystack 2.0 with OpenAI backend.

Best for: enterprise RAG

#haystack#rag
pythonintermediate

LangChain Streaming Callback Handler

Capture LLM tokens as they stream using a custom callback handler for real-time UI updates.

Best for: streaming UI

#langchain#callbacks
pythonadvanced

RAG Evaluation with RAGAS

Evaluate RAG pipeline quality using RAGAS metrics: faithfulness, context recall, and answer relevance.

Best for: RAG evaluation

#ragas#evaluation
pythonintermediate

OpenAI Function Calling with Pydantic

Define type-safe tools for OpenAI function calling using Pydantic models and auto-serialization.

Best for: structured tool calling

#openai#function-calling
pythonintermediate

LangChain Pydantic Output Parser

Use LangChain's PydanticOutputParser to reliably parse structured data from LLM text responses.

Best for: information extraction

#langchain#pydantic
pythonintermediate

Batch Embedding Large Text Corpora

Embed thousands of documents efficiently by batching requests to the OpenAI Embeddings API.

Best for: corpus embedding

#openai#embeddings
pythonintermediate

OpenAI Structured Outputs with JSON Schema

Use OpenAI's strict JSON schema mode to guarantee valid structured output from any model.

Best for: entity extraction

#openai#structured-output
pythonadvanced

Multimodal RAG with Images and Text

Build a multimodal RAG pipeline that retrieves and answers questions about image+text documents.

Best for: visual document Q&A

#multimodal#rag
pythonintermediate

LLM Prompt Testing Framework

Write automated tests for LLM prompts using Python assertions to detect regressions.

Best for: prompt regression testing

#testing#prompts
pythonintermediate

MLflow Experiment Tracking in Python

Track ML experiments, log metrics, parameters, and artefacts with MLflow for reproducible training.

Best for: experiment tracking

#mlflow#experiment-tracking
pythonadvanced

Weights & Biases Hyperparameter Sweeps

Run automated hyperparameter search with W&B Sweeps using Bayesian optimization.

Best for: hyperparameter tuning

#wandb#hyperparameter
pythonintermediate

BentoML Model Serving Service

Package and serve a scikit-learn model as a REST API with BentoML in Python.

Best for: model deployment

#bentoml#model-serving
pythonadvanced

Feast Feature Store in Python

Define, materialise, and retrieve ML features using the Feast open-source feature store.

Best for: feature management

#feast#feature-store
pythonintermediate

SHAP Model Explainability in Python

Explain ML model predictions globally and locally using SHAP values with tree-based models.

Best for: model interpretability

#shap#explainability
pythonintermediate

LIME Local Model Explanation

Generate local interpretable explanations for any black-box classifier using LIME.

Best for: black-box explanation

#lime#explainability
pythonintermediate

Prophet Time Series Forecasting

Forecast time-series data with Facebook Prophet handling holidays, trends, and seasonality.

Best for: sales forecasting

#prophet#forecasting
pythonadvanced

NeuralProphet Deep Time Series Forecast

Forecast complex time series with NeuralProphet combining neural networks and classical decomposition.

Best for: neural forecasting

#neuralprophet#forecasting
pythonadvanced

Transfer Learning with TorchVision

Fine-tune a pretrained ResNet for custom image classification with PyTorch and TorchVision.

Best for: image classification

#pytorch#torchvision
pythonintermediate

OpenCV Face Detection with DNN

Detect faces in images using OpenCV's deep neural network face detector for accurate results.

Best for: face detection

#opencv#computer-vision
pythonbeginner

spaCy Named Entity Recognition

Extract entities, dependencies, and noun phrases from text using spaCy's industrial-strength NLP pipeline.

Best for: entity extraction

#spacy#ner
pythonintermediate

Optuna Hyperparameter Optimization

Automate hyperparameter search with Optuna using Bayesian optimization and pruning.

Best for: AutoML

#optuna#hyperparameter
pythonintermediate

Custom sklearn Pipeline with Transformer

Build a custom scikit-learn Pipeline with a custom BaseEstimator Transformer for data preprocessing.

Best for: custom preprocessing

#sklearn#pipeline
pythonadvanced

Async AI Inference with Celery

Offload slow LLM inference to Celery background workers with Redis as broker and result backend.

Best for: async AI processing

#celery#async
pythonadvanced

Ray Serve ML Model Deployment

Deploy a scalable ML serving endpoint with Ray Serve, handling concurrent requests and model loading.

Best for: ML serving

#ray#model-serving
pythonintermediate

AutoML with FLAML for Fast Tuning

Run automated machine learning with FLAML to find the best model and hyperparameters efficiently.

Best for: automated ML

#automl#flaml
pythonintermediate

LLM Testing with DeepEval

Write unit tests for LLM outputs using the DeepEval framework for correctness and hallucination detection.

Best for: LLM testing

#deepeval#testing
pythonintermediate

PyTorch Lightning Training Loop

Simplify PyTorch model training with Lightning's LightningModule for automatic GPU and logging.

Best for: deep learning training

#pytorch-lightning#training
pythonintermediate

CatBoost Gradient Boosting Training

Train a CatBoost model with automatic categorical feature handling and built-in cross-validation.

Best for: categorical ML

#catboost#gradient-boosting
pythonadvanced

LangChain RAG Retrieval Chain

Build a full RAG pipeline with source citations using LangChain's create_retrieval_chain.

Best for: RAG with citations

#langchain#rag
pythonadvanced

Gymnasium RL Custom Environment

Create a custom reinforcement learning environment with Gymnasium's Env interface.

Best for: custom RL environments

#gymnasium#reinforcement-learning
pythonintermediate

XGBoost with Early Stopping and SHAP

Train an XGBoost model with early stopping and explain predictions using native SHAP integration.

Best for: classification

#xgboost#early-stopping
pythonadvanced

LangChain Agent with Persistent Memory

Build an AI agent that persists conversation context across sessions using LangChain memory stores.

Best for: persistent agents

#langchain#agent
pythonadvanced

Text-to-SQL with Validation Safety

Convert natural language to SQL with LLM and validate queries before execution for safety.

Best for: safe NL2SQL

#nl2sql#sql
pythonadvanced

pgvector Semantic Search in Python

Store OpenAI embeddings in PostgreSQL with pgvector extension for scalable semantic search.

Best for: semantic search

#pgvector#postgres
pythonadvanced

Image Segmentation with SAM in Python

Segment any object in an image using Meta's Segment Anything Model (SAM) with Python.

Best for: object segmentation

#sam#segmentation
pythonadvanced

Fine-Tune Embeddings with SetFit

Fine-tune a sentence embedding model on a small labelled dataset using the SetFit framework.

Best for: few-shot classification

#setfit#embeddings
pythonadvanced

LangGraph Stateful AI Workflow

Build a multi-node AI workflow with conditional routing using LangGraph's StateGraph.

Best for: AI workflows

#langgraph#workflow
pythonintermediate

GPT PDF Summarisation Pipeline

Extract text from PDFs and summarise each section using map-reduce with the OpenAI API.

Best for: document summarisation

#openai#summarisation
pythonintermediate

HuggingFace Text Generation with Streaming

Run local text generation with HuggingFace models and stream output token-by-token to the console.

Best for: local LLM

#huggingface#text-generation
pythonintermediate

LangChain Agent with Tavily Web Search

Build a ReAct agent that searches the web in real-time using the Tavily search tool.

Best for: web search AI

#langchain#tavily
pythonintermediate

Stable Diffusion Text-to-Image in Python

Generate images from text prompts locally using HuggingFace Diffusers and Stable Diffusion XL.

Best for: local image generation

#diffusers#stable-diffusion
pythonadvanced

Semantic Chunking for RAG Documents

Split documents into semantically coherent chunks using embedding similarity for better RAG retrieval.

Best for: RAG optimization

#chunking#rag
pythonadvanced

Parallel Tool Calls with OpenAI

Execute multiple tool calls in parallel when OpenAI returns multiple function calls in one response.

Best for: parallel function calls

#openai#parallel
pythonintermediate

ONNX Runtime Fast ML Inference

Export a PyTorch model to ONNX and run fast CPU inference with ONNX Runtime.

Best for: model deployment

#onnx#inference
pythonintermediate

Prompt Caching with OpenAI API

Reduce costs by up to 50% using OpenAI's automatic prompt caching for repeated context prefixes.

Best for: cost reduction

#openai#caching
pythonadvanced

Graph RAG with Neo4j and LangChain

Build a graph-based RAG system using Neo4j knowledge graph for complex relationship queries.

Best for: knowledge graph Q&A

#neo4j#graph-rag
pythonadvanced

Serverless GPU AI with Modal

Run GPU-accelerated ML inference serverlessly on Modal with automatic scaling and cold start optimization.

Best for: serverless ML

#modal#serverless
pythonadvanced

Speaker Diarization with Whisper + pyannote

Transcribe audio and identify speakers by combining OpenAI Whisper with pyannote.audio diarization.

Best for: meeting transcription

#whisper#diarization
pythonintermediate

LightGBM Feature Importance Analysis

Train a LightGBM model and analyse feature importance using split, gain, and permutation methods.

Best for: feature selection

#lightgbm#feature-importance
pythonintermediate

TabPFN Few-Shot Tabular Classification

Classify tabular data in seconds without hyperparameter tuning using TabPFN's in-context learning.

Best for: few-shot classification

#tabpfn#few-shot
pythonintermediate

CLIP Image-Text Similarity Search

Search images by text description using OpenAI's CLIP model for zero-shot visual semantic search.

Best for: visual search

#clip#multimodal
pythonintermediate

Real-Time Translation Pipeline with OpenAI

Build a language detection and translation pipeline using GPT for multi-language support.

Best for: multilingual apps

#openai#translation
pythonintermediate

Probability Calibration for ML Models

Calibrate classifier probabilities with Platt scaling and isotonic regression for reliable confidence scores.

Best for: probability calibration

#sklearn#calibration
pythonadvanced

Manual OpenAI Agent Loop in Python

Implement a bare-metal AI agent loop with tool execution and conversation management without frameworks.

Best for: custom agents

#openai#agent
pythonadvanced

Flyte ML Pipeline in Python

Define a reproducible machine learning workflow with Flyte's Python SDK for data-to-model pipelines.

Best for: ML orchestration

#flyte#mlops
pythonadvanced

LangChain Self-Query Retriever

Enable natural language metadata filtering in vector search with LangChain's SelfQueryRetriever.

Best for: metadata filtering

#langchain#self-query
pythonadvanced

Stream OpenAI Responses with Tool Calls

Handle streaming responses that include tool calls by accumulating delta chunks from the OpenAI API.

Best for: streaming tool calls

#openai#streaming
pythonintermediate

PydanticAI Structured AI Agent

Build a type-safe AI agent using PydanticAI for validated inputs, outputs, and tool definitions.

Best for: type-safe agents

#pydantic-ai#agent
pythonadvanced

vLLM High-Throughput LLM Serving

Serve open-source LLMs with high throughput using vLLM's PagedAttention for production use.

Best for: high-throughput LLM

#vllm#open-source-llm
pythonbeginner

OpenAI Text-to-Speech Synthesis

Convert text to natural-sounding speech using the OpenAI TTS API with voice selection and streaming.

Best for: text-to-speech

#openai#tts
pythonintermediate

RAG Retrieval Quality Metrics

Compute precision@k, recall@k, and MRR metrics to evaluate vector retrieval quality for RAG.

Best for: retrieval benchmarking

#evaluation#retrieval