🌐 فراتر از مرزها؛ مسیر بین‌المللی CardDev

Harnessing the power of large language models

Chapters
10 Flashcards
11 Gallery cards
31 Audio
10 Prompts
10 Glossary

Imagine you have been building an app that talks to a language model for a month, and suddenly the API bill doubles, answers differ on every run and customers complain. The problem is usually not the model itself but how you harness it: how you send requests, which model you pick and how precise your prompt is. 🔌 Three ways to connect ☁️ OpenAI API: instant access to advanced models, with messages carrying system, user and assistant roles, and parameters such as temperature 🖥️ LM Studio: run open-source models on your own hardware for privacy and zero cloud cost 🌐 Local server: expose that local model like an API to your own apps ✍️ Six prompt tactics | Tactic | Effect | |---|---| | 🔍 A precise query | Reduces ambiguity | | 🎭 A persona | Fixes role and tone | | 🧱 Delimiters | Separate parts of the input | | 🪜 Steps | Make reasoning step by step | | 🎯 Examples | Show the output format | | 📏 Length | Keeps output short and useful | 💡 Do not pick a model by its name; pick it by its criteria: parameter count, training data and method, context window size, speed and cost. ⚖️ Balancing cost and accuracy Keyword extraction does not need GPT-4; analyzing a long legal document makes a big context window vital. The real skill is choosing a model exactly as strong as the need, no stronger. 🧭 What even seniors underestimate The biggest waste in language-model projects comes from automatically choosing the biggest model. A team that relied on GPT-4 for keyword extraction cut cost by about 80 percent by switching to a smaller model, with nearly the same accuracy. So before any choice, ask: "What level of reasoning does my task actually need?"

Chapter

1

Cover of AI Agents in Action
Manning Publications

Chapter 2 of AI Agents in Action: Harnessing the power of large language models

About this chapter

Before you start, take a quick look at what this chapter covers

Before you enter the flashcards, read this summary so your mind is ready and you know exactly what to expect. When you know what problem this chapter solves and why it matters, learning is deeper and faster. Here you see which concepts the chapter covers, how it is structured and how it relates to the other chapters. With this mental preparation, flashcards are no longer memorizing — they are understanding. Your brain sees the connections, not just the words.

Imagine you have been building an app that talks to a language model for a month, and suddenly the API bill doubles, answers differ on every run and customers complain. The problem is usually not the model itself but how you harness it: how you send requests, which model you pick and how precise your prompt is.

🔌 Three ways to connect

  • ☁️ OpenAI API: instant access to advanced models, with messages carrying system, user and assistant roles, and parameters such as temperature
  • 🖥️ LM Studio: run open-source models on your own hardware for privacy and zero cloud cost
  • 🌐 Local server: expose that local model like an API to your own apps

✍️ Six prompt tactics

TacticEffect
🔍 A precise queryReduces ambiguity
🎭 A personaFixes role and tone
🧱 DelimitersSeparate parts of the input
🪜 StepsMake reasoning step by step
🎯 ExamplesShow the output format
📏 LengthKeeps output short and useful

💡 Do not pick a model by its name; pick it by its criteria: parameter count, training data and method, context window size, speed and cost.

⚖️ Balancing cost and accuracy

Keyword extraction does not need GPT-4; analyzing a long legal document makes a big context window vital. The real skill is choosing a model exactly as strong as the need, no stronger.

🧭 What even seniors underestimate

The biggest waste in language-model projects comes from automatically choosing the biggest model. A team that relied on GPT-4 for keyword extraction cut cost by about 80 percent by switching to a smaller model, with nearly the same accuracy. So before any choice, ask: "What level of reasoning does my task actually need?"

Book release

Published

Chapter 2 progress
Book progress

Reading time

00:27

Gallery

Yes

Audio status

Preview

Analysis

AI