Skip to content

Lin-dev/introduction-to-ai-engineering

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Introduction to AI Engineering (for software engineers)

By Obinna Okechukwu

What you learn

After completing this book, you will:

  • Be able to implement production AI systems with confidence
  • Have deep understanding of all major AI APIs
  • Have a good understanding of common prompt engineering techniques
  • Be able to design and deploy AI agents
  • Be able to make informed architectural decisions
  • Be able to work proficiently with multimodal AI applications

Book Structure

Part 1: Foundations (Chapters 1-8)

  • What are LLMs and how do they work?
  • The paradigm shift: describing vs. instructing
  • Your first AI call in Python
  • The structure of a conversation (roles: system, user, assistant)
  • Practical example: IoT status interpreter
  • A simple mental model: tokens, embeddings, prediction
  • The landscape of AI models
  • Tokens and cost calculation
  • Using tiktoken to count tokens
  • Embeddings and semantic search
  • Context windows and memory limitations
  • Practical example: semantic search for IoT troubleshooting
  • Managing conversation history
  • Python environment setup
  • Essential libraries: openai, python-dotenv
  • API key security and secret management
  • Project structure and virtual environments
  • Building a command-line AI chatbot
  • Creating requirements.txt
  • Core strengths of LLMs
  • Common failure modes (hallucinations, math, real-time info)
  • Safeguards and best practices
  • Building a safe assistant class
  • Example: SmartSafeAssistant

Part 2: API Mastery (Chapters 5-12)

  • Making your first API call
  • System messages and personality
  • Managing conversation history
  • Controlling creativity (temperature, max_tokens)
  • Streaming responses
  • Function calling
  • Vision and audio capabilities
  • Example: E-commerce recommendation assistant
  • Claude API basics and differences from OpenAI
  • System prompts and persona control
  • Long-context analysis and document Q&A
  • Vision and tool use
  • Example: IoT fleet management with visual diagnostics
  • Model comparison and selection
  • Gemini API setup and multimodal capabilities
  • Video, audio, and PDF analysis
  • Function calling and tool integration
  • Building a predictive maintenance system
  • Model comparison and integration with Google services
  • Retry strategies and exponential backoff
  • Rate limiting and quotas
  • Streaming vs batch responses
  • Caching strategies
  • Multi-provider failover
  • Example: Production-grade IoT command processor

Part 3: Prompt Engineering Mastery (Chapters 9-14)

  • Anatomy of effective prompts
  • Zero-shot, few-shot, and chain-of-thought prompting
  • Role-based prompting
  • A/B testing prompts
  • Practical IoT diagnostic system
  • Self-consistency
  • Tree-of-thought prompting
  • ReAct (Reasoning and Acting)
  • Constitutional AI
  • Prompt chaining and workflows
  • JSON mode and structured outputs
  • Pydantic integration and schema validation
  • Constrained code generation
  • Template-based code generation
  • Example: IoT configuration generator
  • Technical documentation generation
  • Domain-specific code generation and review
  • Data analysis and insights
  • Customer service and troubleshooting guides

Part 4: Building AI Agents (Chapters 13-18)

  • Chatbots vs. agents
  • The Perceive-Think-Act loop
  • Agent components: perception, memory, reasoning, action
  • Building an autonomous IoT agent
  • The two-step tool use loop
  • Implementing function calling (OpenAI, Claude, Gemini)
  • Tool registry and secure execution
  • Orchestrating tool chains
  • Security and permission management
  • Agent frameworks (LangChain, AutoGen, CrewAI)
  • State management and persistence
  • Communication protocols
  • Observability: logging, metrics, tracing
  • Example: Industrial automation agent
  • Multi-agent collaboration patterns
  • Message passing and coordination
  • Consensus mechanisms
  • Hierarchical agent structures
  • Example: Smart city IoT coordination system

Part 5: Python Web Applications (Chapters 17-19)

  • Flask and FastAPI for AI endpoints
  • File uploads (images, audio, PDFs)
  • Streaming responses and SSE
  • WebSockets for real-time updates
  • Example: IoT device management dashboard
  • WebSocket integration
  • Background task processing with Celery
  • Caching strategies
  • Rate limiting and queue management
  • Example: Real-time IoT anomaly detection
  • Monolith vs. microservices
  • Event-driven architectures
  • Database patterns (polyglot persistence)
  • Configuration management
  • Example: Scalable IoT analytics platform

Part 6: Production Systems (Chapters 20-25)

  • Scaling challenges unique to AI
  • Horizontal scaling and load balancing
  • Queue-based architectures
  • Database design for AI workloads
  • Multi-level caching
  • Example: Global IoT platform architecture
  • Token usage and cost structure
  • Semantic caching
  • Model selection strategies
  • Batch processing
  • Cost monitoring and ROI
  • Example: Cost-effective IoT analysis
  • API key management and secret storage
  • Prompt injection and input sanitization
  • Output filtering and moderation
  • Audit logging and compliance
  • Example: Secure healthcare IoT system
  • Structured logging
  • Metrics and KPIs
  • Distributed tracing
  • Real-time monitoring dashboards
  • Example: IoT system health dashboard
  • Unit and integration testing for AI
  • Regression testing with golden datasets
  • Load testing AI endpoints
  • Example: IoT command validation testing
  • CI/CD for AI applications
  • Environment management
  • Blue-green deployments
  • Feature flags for AI features
  • Rollback strategies
  • Example: IoT firmware update system

Part 7: Advanced Topics (Chapters 26-30)

  • When to fine-tune vs. prompt engineering or RAG
  • Data preparation for fine-tuning
  • Running a fine-tuning job
  • Evaluating and deploying custom models
  • Example: Specialized IoT assistant
  • RAG workflow: indexing, retrieval, generation
  • Vector databases and embeddings
  • Building a RAG-powered assistant
  • RAG vs. fine-tuning
  • Example: IoT documentation assistant
  • From chains to workflows (DAGs)
  • Building a workflow orchestrator
  • Error handling and retries
  • Human-in-the-loop patterns
  • Example: Automated IoT incident response
  • True multimodal AI
  • Edge AI deployment
  • Federated learning
  • Quantum computing and AI
  • Example: Next-gen IoT architectures
  • From technology to solution: product thinking
  • The Lean AI Canvas
  • MVPs and data flywheels
  • Ethical review and safety
  • Launching and iterating AI products

Additional Resources

General AI Engineering & LLMs

Prompt Engineering

AI Agents & Autonomous Systems

RAG (Retrieval-Augmented Generation)

Benchmarks, Datasets, and Evaluation

Community & News


About

Introduction to AI Engineering book

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published