PHP AND LLMs
PHP AND LLMs
Practical Integrations using Laravel
About the Book
This book is a practical guide for PHP developers navigating the rapidly evolving landscape of Large Language Models (LLMs). Moving beyond the hype, it delves into real-world applications and solutions, providing step-by-step instructions on how to integrate LLMs into your existing projects.
From mastering prompts to building reusable tools and working with various LLMs, this book equips you with the skills needed to leverage the power of Ai in everyday development tasks.
Whether you’re looking to automate complex workflows, enhance content verification, or simply stay ahead in a changing industry, this book offers the insights and hands-on examples to get you there. This isn’t just another “Hello World” guide—it’s a deep dive into the future of PHP development, focusing on real solutions that drive real results.
Sample book here https://bit.ly/php_llms_sample
See all the code at https://github.com/alnutile/php-llms
Table of Contents
- [COMPLETE] Introduction - Embracing the Reality of LLMs in Development
- Code Examples
- [COMPLETE] Why Use LLMs
- What You’ll Learn
- Big Picture View
- It is your pair coding colleague
- It is there to do the grunt work for you
- It is there to help you try new ways to solve problems for your customers and yourself.
- It Can Empower Your Users
- Why Not LLMs?
- Wrapping it up
- What You’ve Learned
- [COMPLETE] Local LLMs: Streamlining Your Development Workflow
- Big Picture
- What You Will Learn
- Setting up your local Computer
- Ollama
- HTTP Client with Tests
- Using the Chat Method
- Update Client for Chat
- Real Use Case - News Summary
- What You Learned
- [COMPLETE] Building the LLM Agnostic Driver
- Summary of What You Will Learn
- Summary of What You Will Learn
- Step One: The Facade
- Step Two: Mock Client and Data Objects
- Step Three: OllamaClient
- Step Four: Claude, Groq, OpenAI
- Extra Features
- What You’ve Learned
- Links
- [COMPLETE] Prompting Overview
- What You’ll Learn
- Big Picture View
- The term “Prompt Engineering” is not as stupid as I first thought!
- Keep it simple
- System Prompt
- First Shot vs Multi-Shot
- Tools
- Place Holders
- Putting it all together
- What You’ve Learned
- Links
- [COMPLETE] Parsing Opt-Out Text
- Summary of What You Will Learn
- The Goal
- What You Have Learned
- [COMPLETE] Tools Overview - Enhancing LLM Capabilities
- The Tool Flow In Detail
- Claude and Tools
- Tool Response
- How can we test this?
- In Summary
- [COMPLETE] - Web Scraping and Building an Events Database
- Summary of What You Will Learn
- Big Picture View
- Orchestration
- Deep Dive
- What You’ve Learned
- [COMPLETE] Agnostic Tools
- What you will learn:
- Intro
- Curl and JSON
- Claude
curl
- OpenAI
curl
- Agnostic Tools Prism
- Stand-Alone Classes
- When to Attach Tools
- What Next?
- Chaining Tools
- Web Searches with LLMs
- [COMPLETE] Marketing Assistant and Other Automations
- What you will learn in this chapter
- The Model Structures and the Reasoning
- Starting the Project
- Scheduler
- Automations aka Agents
- Email to Google Sheets
- Step Three: Automation with Feedback Flow
- Hand Written Notes to Task List
- [COMPLETE] RAG and Vector
- What You Will Learn About Building a RAG System
- Why RAG?
- What’ll we do with RAG?
- Getting Your Application Database Set up
- Data and Ingestion
- Document Table
- Chunk Table
- Ingestion and Embedding
- Embedding
- Our First RAG Question
- Pull in all the Files and Computer Considerations
- Adding Images
- Adding Voice
- Unstructured vs Structured
- Beyond RAG
- What You Learned
- SiteMap - Feed to RAG
- Agents to Evaluate the Results
- [COMPLETE] Standards Checking Tool
- What You Will Learn
- Intro
- Process Overview
- Step one: Breaking up the PDF Page
- Review Report Page Job
- Finalize ReportJob
- Limitations
- Summary
- Final Thoughts
- Resources
- Deeplearning.ai
- HuggingFace
- Troubleshooting Tips and Tricks
- Saving JSON Messages and Payload
- Alphabetically Sorted Terminology
- API (Application Programming Interface)
- Agnostic Tools
- Assistant
- Automation
- Batch Jobs
- Batch Processing
- Chat
- CI (Continuous Integration)
- Completion
- CompletionResponse
- Context Window
- Cron jobs
- Data Transfer Object (DTO)
- Driver Pattern
- Embedding
- Facade Pattern
- Fine-tuning
- First-Shot Prompting
- Fixture
- FunctionResponse
- GIS (Geographic Information System)
- Groq
- Hallucination
- HTTP Facade
- HTTP Pooling
- Inference
- LangChain
- Laravel
- Laravel Dependency Injection
- LLM (Large Language Model)
- LLM Agnostic Driver
- LLM Router
- Machine Learning
- Message Thread
- Mixture of Agents
- Mock
- Mock Driver
- Multi-shot Prompting
- Multi-shot Strategy
- NativePHP
- Ollama
- Orchestrate Class
- Placeholder
- Prism
- Process Facade
- Prompt
- Prompt Engineering
- Prompt Injection
- RAG (Retrieval-Augmented Generation)
- Real-Time Facades
- Round-Robin
- Round-Robin
- Scheduling Prompt
- Sentiment Analysis
- System Prompt
- Task Scheduling
- Temperature
- Templatizer
- Throttling
- TLDR
- Token
- Tool (in LLM context)
- Tool Schema
- LLM (Large Language Model)
- Tool Chaining
- Tool Calling
- Tool Driven Design (TDD)
- Tool
- Tool Invocation
- User Prompt
- [COMPLETE] Introduction - Embracing the Reality of LLMs in Development
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $14 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them