Developing Apps with GPT-4 and ChatGPT

Book description

This mini-book is a comprehensive guide for Python developers who want to learn how to build applications with large language models. Authors Olivier Caelen and Marie-Alice Blete cover the main features and benefits of GPT-4 and ChatGPT and explain how they work. You'll also get a step-by-step guide for developing applications using the GPT-4 and ChatGPT Python library, including text generation, Q&A, and content summarization tools.

Written in clear and concise language, Developing Apps with GPT-4 and ChatGPT includes easy-to-follow examples to help you understand and apply the concepts to your projects. Python code examples are available in a GitHub repository, and the book includes a glossary of key terms. Ready to harness the power of large language models in your applications? This book is a must.

You'll learn:

  • The fundamentals and benefits of ChatGPT and GPT-4 and how they work
  • How to integrate these models into Python-based applications for NLP tasks
  • How to develop applications using GPT-4 or ChatGPT APIs in Python for text generation, question-and-answer, and content summarization, among other tasks
  • Advanced GPT topics, including prompt engineering, fine-tuning models for specific tasks, plug-ins, and more

Publisher resources

View/Submit Errata

Table of contents

  1. 1. GPT-4 and ChatGPT Essentials
    1. Introducing Large Language Models
      1. Exploring the Foundations of Language Models and NLP
      2. Understanding Transformer Architectures and Their Role in LLMs
      3. Demystifying the Tokenization and Prediction Steps in GPT Models
    2. A Brief History: from GPT-1 to GPT-4
      1. GPT-1
      2. GPT-2
      3. GPT-3
      4. From GPT-3 to InstructGPT
      5. GPT-3.5, Codex, and ChatGPT
    3. Large Language Model Use Cases and Example Products
      1. Be My Eyes
      2. Morgan Stanley
      3. Khan Academy
      4. Duolingo
      5. Yabble
      6. Waymark
      7. Inworld AI
    4. Beware of AI Hallucinations: Limitations and Considerations
    5. Optimizing GPT Models with Plugins and Fine-Tuning
    6. Summary
  2. 2. Taking a Deep Dive into the GPT-4 and ChatGPT APIs
    1. Prerequisites
      1. OpenAI Usage Policy
      2. Essential OpenAI Concepts
    2. Models Available in OpenAI API
    3. Trying GPT Models with the Playground
    4. Getting Started: First Steps with the OpenAI Python Library
      1. OpenAI Access and API Key
      2. Hello World with OpenAI
    5. Using ChatGPT and GPT-4
      1. Input Options for the Chat Completion Endpoint
      2. Output Result Format for the Chat Completion Endpoint:
    6. Using Other Text Completions Models
      1. Input Options for the Text Completion Endpoint
      2. Output Result Format for the Text Completion Endpoint:
    7. Mastering Text Editing with GPT
    8. Moderation Model
    9. Considerations
      1. Pricing and Token Limitations
      2. Security and Privacy: Caution!
    10. Other OpenAI APIs and Functionalities:
      1. Image Generation with DALL-E
      2. Embeddings
      3. Whisper
    11. Summary & Cheatsheet
  3. 3. Advanced Techniques to Unlock the Full Potential of GPT-4 and ChatGPT
    1. Mastering Prompt Engineering Techniques
      1. Designing Effective Prompt
      2. Thinking Step by Step
      3. Explaining Few-Shot Learning
    2. Unleashing the Power of GPT with Fine-Tuning
      1. Exploring Fine-Tuning Applications
      2. Preparing your Data for Fine-Tuning
      3. Adapting GPT Base Models for Domain-Specific Needs
      4. Mastering Fine-Tuning with the OpenAI API
      5. Generating Synthetic Data and Fine-Tuning for an Email Marketing Campaigns Tool
      6. Evaluating Price Implications of Fine-Tuning
    3. Summary
  4. About the Authors

Product information

  • Title: Developing Apps with GPT-4 and ChatGPT
  • Author(s): Olivier Caelen, Marie-Alice Blete
  • Release date: January 2024
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781098152468