ailiteracynepal 🇳🇵
Text size

Chapter 05 · Section I · 22 min read

Pre-trained models: standing on others' shoulders

Almost no one building AI today trains their own models from scratch. They use models someone else trained — for free, or for cents — and put their effort into the surrounding system. Understand the deal first; the code comes next.

Everything you have done in the first four chapters is the substrate — the workshop, the language, the data tools, the habits. From this chapter on, you are doing the thing the track is named for: building with AI. The shape that almost every working AI builder takes today is not “train a model”; it is “use one someone else trained, and wrap it well.” This section is the picture of the world you are joining.

What “pre-trained” means

A model is a mathematical function that maps inputs to outputs. Training a model means showing it many examples and adjusting its internal numbers until it gets the examples mostly right. Training a large model means doing this with billions of examples and billions of internal numbers — which requires thousands of expensive computers running for weeks or months, and tens of millions of US dollars.

A pre-trained model is a model someone else has already paid that cost on. They have done the training. They publish either the model itself (the numbers, called weights) or an API you can call to use it. You inherit all the learning, instantly, for somewhere between free and very cheap.

This is not a small thing. Five years ago, the only way to use a state-of-the-art language model was to train one. Today the same model — better, even — can be called from a Nepali bedroom for less than the cost of a packet of Wai Wai.

Two ways to get a model

When you say “use a pre-trained model”, you mean one of two things:

1. Download it and run it on your own machine. The model’s weights are public; you install a library (usually transformers from Hugging Face, or torch, or tensorflow), point it at the weights, and run inputs through it. Free. Private (the data never leaves your computer). Limited by your hardware — small and medium models fit comfortably on a modern laptop; the very large ones do not.

2. Call it as a hosted API. Someone else runs the model on their servers; you send a request over the internet and pay per use. Expensive at scale, but trivially fast to set up, no hardware constraints, and you get the very biggest models without owning a GPU.

For Course 01, we will do both — local for the OCR demo in Section 3, hosted for the language model in Section 2. The choice between them is the recurring question of this track.

The ecosystem you are entering

A short tour of the names you will see for the rest of the course:

Hugging Face is the great library of pre-trained models. Tens of thousands of them: language models, vision models, speech models, models trained specifically on Nepali, models trained for Devanagari OCR. Their site (huggingface.co) is the GitHub of models. The Python library transformers is how you load and run almost any of them locally.

OpenAI, Anthropic, Google, Mistral, Cohere — the main commercial labs that host very large language models behind APIs. You pay per million tokens of input and output. We use Anthropic’s Claude in Section 2 because the API is clean; OpenAI’s GPT and Google’s Gemini look almost identical from a code perspective.

Tesseract — an old, open, free OCR engine maintained by Google. Not the most modern, but good enough for printed Devanagari and runs on your laptop. We will use it in Section 3.

PyTorch and TensorFlow — the two main frameworks underneath everything else. You will rarely write PyTorch code directly in this track; most libraries we use sit on top of it. Knowing the name matters because you will see it in install logs and error messages.

What pre-trained models give you, and what they do not

A short, honest list.

What you get for free or near-free:

  • A language model that can translate, summarise, draft, answer, and reason at a level that would have been science fiction in 2018.
  • A vision model that can read text from photos, identify objects, describe scenes.
  • A speech model that can transcribe both English and Nepali audio with serviceable accuracy.
  • An embedding model that turns text into numbers — the key ingredient for semantic search and most recommendation systems.

What you do not get:

  • A model trained specifically on the patterns of your problem. Out-of-the-box, the model knows about the world in general — not about your shop’s customers, your school’s grading scale, or your district’s micro-irrigation history.
  • Reliability. Models hallucinate, mis-read, mis-translate. Your job as a builder is to design the system so that mistakes are caught, flagged, or recovered from.
  • Privacy of inputs, when you use a hosted API. Anthropic, OpenAI, and Google see whatever you send them. For sensitive data — medical records, legal documents — this is a real consideration, and reason to prefer a model you run locally.
  • Cost-free scale. The first thousand requests are cheap. The first ten million may not be.

We will return to each of these as the track moves through Course 04 (language models) and Course 05 (shipping).

A word on Nepali language coverage

Most large language models in 2026 are usable in Nepali — Claude, GPT-4 and -5 series, Gemini all handle Devanagari competently for everyday tasks. They are excellent for English-to-Nepali translation, decent at understanding Nepali questions, and merely passable at producing fluent Nepali long-form writing.

The reason is data: there is more English on the internet than Nepali by a factor of hundreds. A model that has seen a billion English sentences and ten million Nepali ones will speak both — but more confidently in one.

This is a constraint, but also an opportunity. A Nepali builder who knows both the local context and the right ways to prompt a multilingual model can produce results no foreign team can match — because they understand both halves of the gap. Course 04 spends real time on this.

A working mental model

To carry forward, three sentences:

  1. Pre-trained models are the substrate of modern AI building. You do not train them; you call them.
  2. There are two ways to call them: locally (download the weights, run on your machine) or hosted (call an API, pay per use).
  3. The builder’s job is everything around the model: the data, the prompt, the interface, the trust.

If those three feel intuitive, you are ready for the next section — your first hands-on call to a real language model.

Check your understanding

Quick check

Which of the following best describes the typical workflow of an AI builder in 2026?

Quick check

A friend is building a small tool that processes confidential medical records from a clinic in Bhairahawa. Which is the most thoughtful choice of model deployment?

What comes next

Theory becomes code. In the next section, you sign up for an Anthropic account, get an API key, and make your first call to Claude from a Python notebook. Twenty minutes of setup, ten lines of code, and you will have built — for real — the smallest end-to-end AI application of the entire track.