6.0 Hands-On with LLMs

Published on: 2024-10-03 Last updated on: 2026-08-24 Version: 7

Bringing large language models (LLMs) into your projects has never been easier. Thanks to a rich ecosystem of open-source libraries and cloud APIs, you can now experiment with pretrained models, fine-tune them, and even deploy scalable inference services with minimal setup.

In Chapter 6.1 of my book, we explore four leading options—Hugging Face Transformers, OpenAI API, Google Cloud Vertex AI, and Microsoft Azure Cognitive Services—highlighting their features and practical usage examples.

One line: The right tool depends less on which model is “best” and more on where you want the weights to live and who you want to trust with the operations.
Choosing an LLM tool Ask these questions in order Do you need on-prem / private weights? Yes → Hugging Face Self-host, fine-tune anything Already in a cloud stack? No → OpenAI API Fastest path to production GCP → Vertex BigQuery / Dataflow Azure → ACS SLA / compliance Rule of thumb Prototype with the shortest path, then migrate only when a hard constraint forces the move.
Figure 6.1a—A decision flow for picking the right LLM entry point.

At-a-Glance Comparison

Hugging FaceOpenAI APIVertex AIAzure Cognitive Services
Model accessOpen-source weights, self-hostHosted GPT-4/etc.Hosted + AutoMLHosted NLP endpoints
Setup effortMedium (Python + GPU)Minimal (API key)Medium (GCP project)Minimal (Azure resource)
CustomizationFull control, fine-tune anythingLimited fine-tuningAutoML + custom trainingTask-specific tuning
Best fitResearch, prototypes, on-premFastest path to productionEnterprise data pipelinesRegulated / SLA-driven workloads
Cost modelYour infra costPer-token API chargesPer-request + computePer-transaction

What You’ll Discover

1. Hugging Face Transformers

The go-to open-source library for LLMs, Hugging Face offers thousands of pretrained models (BERT, GPT, T5, LLaMA, Falcon) with ready-to-use pipelines for text generation, classification, translation, and question answering. It’s flexible, widely supported, and perfect for experimentation.

2. OpenAI API

If you want managed access to cutting-edge models like GPT-4 without handling infrastructure, the OpenAI API is your fastest path. With REST endpoints for chat, summarization, code generation, and more, it provides enterprise-grade reliability in minutes.

3. Google Cloud AI (Vertex AI)

For enterprises needing deep integration, Google Cloud’s Vertex AI offers pretrained NLP models, AutoML for custom training, and seamless links to BigQuery and Dataflow. It’s designed for large-scale, production-ready deployments.

4. Microsoft Azure Cognitive Services

Azure provides robust, enterprise-grade NLP endpoints—sentiment analysis, translation, question answering—backed by compliance, security, and SLA guarantees. Ideal for mission-critical workloads.

Key Takeaways

  • Hugging Face Transformers: Best for local experimentation and control.
  • OpenAI API: Simplest way to access cutting-edge LLMs without infrastructure overhead.
  • Google Cloud Vertex AI: Enterprise-friendly with integrated pipelines and AutoML.
  • Azure Cognitive Services: Reliable, compliant AI APIs for production use.
Worth holding onto: Cost, latency, and compliance become the real differentiators once you leave the prototype stage—raw model quality gets you in the door, but operating characteristics decide who stays.

SHO
SHO
CTO of Receipt Roller Inc., he builds innovative AI solutions and writes to make large language models more understandable, sharing both practical uses and behind-the-scenes insights.

Questions & answers

Have a question about this topic? Ask below — no sign-up needed. The team reviews and answers questions here.

No questions yet — be the first to ask.

Ask a question

We’ll send a one-time email to confirm your address. Questions appear after a quick review.