ApX logoApX logo
ModelsCalculatorHardwareCoursesPricing
ApX logoApX logo
ModelsCalculatorHardwareCoursesPricing

All Courses

Getting Started with Local LLMs
Chapter 1: Introduction to Large Language Models
What Is a Large Language Model (LLM)?
A Simple View of How LLMs Work
Understanding Tokens and Text Generation
Why Run LLMs Locally?
Local vs. Cloud-Based LLMs
Quiz for Chapter 1
Chapter 2: Preparing Your Local Environment
Hardware Considerations: CPU
Hardware Considerations: RAM
Hardware Considerations: GPU and VRAM
Checking Your System Specifications
Operating System Compatibility
Installing Python (Optional but Recommended)
Introduction to the Command Line / Terminal
Quiz for Chapter 2
Chapter 3: Finding and Selecting Local LLMs
Where to Find LLM Models: Hugging Face Hub
Understanding Model Sizes and Parameters
Model Formats: GGUF and Others
Quantization: Making Models Smaller
Reading Model Cards for Information
Model Licenses and Usage Restrictions
Choosing Your First Model
Quiz for Chapter 3
Chapter 4: Running Your First Local LLM
Introduction to Local LLM Runners
Setting up Ollama
Downloading a Model with Ollama
Running a Model with Ollama (Command Line)
Setting up LM Studio
Finding and Downloading Models in LM Studio
Loading and Chatting with a Model in LM Studio
Introduction to llama.cpp (Concept)
Hands-on Practical: Running a Model
Quiz for Chapter 4
Chapter 5: Basic Interaction and Prompting
What is a Prompt?
Your First Prompt: Simple Questions
Giving Instructions
Understanding Context Window
Basic Prompt Formatting Tips
Temperature and Creativity
Common Interaction Patterns
Practice: Simple Prompting Techniques
Quiz for Chapter 5
Building a Customized Local AI Assistant

Giving Instructions

Local Large Language Models (LLMs) can answer straightforward questions. A main capability of LLMs is following specific instructions to perform tasks on text provided or topics specified. Rather than asking what, you can tell the model what to do.

Think of it like giving a command to a helpful assistant. You need to state clearly what action you want the model to take. This involves structuring your prompt around an instruction.

A basic instructional prompt usually contains:

  1. A Clear Action: Start with a verb that describes the task. Common verbs include "Summarize," "Translate," "Rewrite," "List," "Explain," "Generate," or "Extract."
  2. The Target: Specify the text or the subject matter the action applies to.
  3. Optional Constraints (Sometimes): You can often add details about how you want the output formatted or styled, like "in one sentence," "using bullet points," or "in a simple way."

Let's look at some common examples:

Summarization

If you have a long piece of text and need the main points, you can instruct the LLM to summarize it.

Example Prompt:

Summarize the following paragraph into a single sentence:

Large Language Models are complex artificial intelligence systems trained on immense amounts of text data. They learn patterns, grammar, and facts from this data, allowing them to understand prompts and generate human-like text in response. Running them locally offers benefits like privacy and offline use, but requires sufficient hardware resources like RAM and sometimes a GPU.

Potential LLM Output:

Large Language Models are AI systems trained on massive datasets that generate human-like text, offering local use benefits like privacy at the cost of hardware requirements.

You can adjust the instruction, for example, asking for a summary in bullet points instead of a single sentence.

Translation

Many LLMs have multilingual capabilities. You can instruct them to translate text between languages.

Example Prompt:

Translate the following English sentence to Spanish: "Hello, how are you today?"

Potential LLM Output:

Hola, ¿cómo estás hoy?

Rewriting and Rephrasing

You can ask the model to change the tone, style, or complexity of a piece of text.

Example Prompt 1 (Changing Tone):

Rewrite this sentence to sound more professional: "We gotta fix the bugs before the customer sees them."

Potential LLM Output:

It is necessary to address the software defects prior to customer review.

Example Prompt 2 (Simplifying):

Explain the concept of 'RAM' in simple terms, like you're talking to someone who doesn't know computers well.

Potential LLM Output:

Think of RAM as your computer's short-term workspace. When you open a program, the computer puts the information it needs right now into RAM so it can access it very quickly. More RAM is like having a bigger desk, allowing you to work on more things at once without slowing down. It forgets everything when you turn the computer off, unlike long-term storage like a hard drive.

Listing Information

You can instruct the model to extract and list specific types of information.

Example Prompt:

List the three main hardware components discussed for running local LLMs.

Potential LLM Output:

1. CPU (Central Processing Unit)
2. RAM (Random Access Memory)
3. GPU (Graphics Processing Unit) / VRAM (Video RAM)

Basic Code Generation

Some models can even generate simple code snippets based on instructions. The quality and complexity they can handle depend heavily on the specific model you are using (as discussed in Chapter 3).

Example Prompt:

Write a basic Python function called 'add' that takes two numbers as input and returns their sum.

Potential LLM Output:

def add(number1, number2):
  """
  This function takes two numbers and returns their sum.
  """
  return number1 + number2

The Importance of Clarity

The effectiveness of your instruction often depends on how clearly you state it. Ambiguous instructions can lead to unexpected or unhelpful results.

Here's the difference:

  • Less Clear: Tell me about the Python programming language. (This could result in history, features, installation steps, or anything else).
  • Clearer: List three common uses for the Python programming language.
  • Also Clearer: Explain what makes Python a popular choice for beginners.

Experiment with different ways of phrasing your instructions. Use strong action verbs and be as specific as possible about the input text and the desired output. Different models might respond better to slightly different phrasing, so trying variations is part of learning how to interact with them effectively.

Keep in mind that even with clear instructions, LLMs are not perfect. They might misunderstand complex requests or fail to follow multi-part instructions accurately, especially with smaller models or very long prompts. For now, focus on these basic single-step instructions. Getting these right is the foundation for more advanced interactions. As you progress, you'll learn techniques to handle more involved tasks, often relating to how the model remembers prior parts of the conversation, a concept we'll explore next when discussing the context window.

  • Scaling Instruction-Finetuned Language Models, Hyung Won Chung, Le Hou, Shayne Longpre, Barret Zoph, Yi Tay, William Fedus, Yunxuan Li, Xuezhi Wang, Mostafa Dehghani, Siddhartha Brahma, Albert Webson, Shixiang Shane Gu, Zhuyun Dai, Mirac Suzgun, Xinyun Chen, Aakanksha Chowdhery, Alex Castro-Ros, Marie Pellat, Kevin Robinson, Dasha Valter, Sharan Narang, Gaurav Mishra, Adams Yu, Vincent Zhao, Yanping Huang, Andrew Dai, Hongkun Yu, Slav Petrov, Ed H. Chi, Jeff Dean, Jacob Devlin, Adam Roberts, Denny Zhou, Quoc V. Le, Jason Wei, 2022 arXiv preprint arXiv:2210.11416 DOI: 10.48550/arXiv.2210.11416 - This paper presents the FLAN method, showcasing how instruction tuning significantly enhances LLMs' ability to generalize to new tasks and follow diverse instructions.
  • Prompt engineering guide, OpenAI, 2023 (OpenAI) - An official guide offering practical advice and strategies for effective prompt engineering, including clear instruction formulation, task definition, and output formatting.
  • Practical Prompt Engineering: A Comprehensive Guide to Interacting with Large Language Models, Hady W. Lau, Wei-Meng Lee, Kenneth C. Lee, 2023 (Wiley) - This book offers a guide to crafting effective prompts for LLMs, covering various techniques and strategies for different tasks, directly relevant to giving instructions.
  • Language Models are Few-Shot Learners, Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, Dario Amodei, 2020 Advances in Neural Information Processing Systems 33 (NeurIPS 2020), Vol. 33 (NeurIPS) DOI: 10.48550/arXiv.2005.14165 - This paper demonstrates the strong in-context learning abilities of large language models, showing how they can perform new tasks with only a few examples or clear instructions provided in the prompt.

© 2026 ApX Machine Learning