"If I'm already a JavaScript developer, what do I actually need to learn to become an AI engineer?"
That's the real question, and it deserves a real answer, not another "AI is changing the world" opener. If you already build software, you're closer to this than it feels. Frontend, backend, APIs, databases, authentication, queues, caching, infrastructure, SaaS architecture, all of that transfers directly. The missing piece isn't software engineering skill. It's understanding how AI models actually work and how to wire them into systems that stay reliable once real users and real data show up.
This is a standalone guide to that missing piece, not an intro to a course. If you finish it, you should have a clear, technically grounded map of the field, not a list of buzzwords.
What an AI engineer actually does
An AI engineer doesn't necessarily train models from scratch. Most don't. An AI engineer builds production applications and systems around existing models, while understanding enough of what's underneath to make sound engineering decisions on architecture, cost, latency, and reliability.
There's a spectrum, and different roles sit at different points on it:
Calling an LLM API
↓
Building LLM applications
↓
RAG
↓
Tool calling
↓
Agents
↓
Evaluation
↓
Fine-tuning
↓
Model serving
↓
Model optimization
↓
Training models
An AI engineer typically lives in the upper half of that list. A machine learning engineer or researcher typically lives lower down. Neither is "more real" than the other; they're different jobs solving different problems, and this guide is specifically about the upper half, the part a JavaScript developer is already closest to.
Concretely, AI engineers build things like document processing pipelines, AI-powered search, customer support systems, agents that take action on a user's behalf, data analysis tools, recommendation systems, lead classification, content extraction, and business process automation. In almost every one of these, the AI model is one component of a larger system, not the whole system:
User
↓
Application
↓
Backend/API
↓
AI orchestration
/ | \
↓ ↓ ↓
RAG Tools Database
\ | /
\ | /
AI Model
↓
Structured output
↓
Application
Most of the actual engineering happens around the model, not inside it. That's the part that looks exactly like the SaaS architecture you already know.
AI engineer versus machine learning engineer
Real job titles overlap constantly, and different companies use these terms inconsistently, so treat this as a rough map, not a rulebook.
An AI engineer typically focuses on building AI-powered applications: integrating models, LLM APIs, RAG, embeddings, vector databases, agents, tool calling, evaluation, AI security, observability, cost optimization, production architecture, inference, and model selection.
A machine learning engineer typically focuses more on training models directly: data pipelines, feature engineering, model training, experimentation, deployment of trained models, classical ML, deep learning, and model optimization at the training level.
If your background is JavaScript and TypeScript, the AI engineer side of that list is the one that reuses almost everything you already know.
What an LLM actually is
A large language model is a model trained on enormous amounts of text to predict what token is likely to come next, given everything that came before it. "Model" here means what it usually means in software: a system that's learned patterns from data and can apply them to new input.
Training data
↓
Training
↓
Model weights
↓
Trained model
↓
Inference
↓
Output
Training is the expensive, offline process of adjusting a model's internal parameters, its weights, based on massive datasets. Inference is what happens every time you send it a prompt afterward: running your input through those already-trained weights to get an output. As a developer building applications, you're almost always working at the inference stage. Training is a different job entirely, and one this guide isn't trying to prepare you for.
API versus model
This distinction matters more than it sounds like it should.
An API is the interface your application uses to talk to a model. The actual neural network computation happens somewhere behind that interface, on infrastructure you don't see and usually don't need to.
Your TypeScript application
↓
HTTP/API
↓
AI provider
↓
LLM model
↓
Response
In code, that's just an HTTP call with extra ceremony:
const response = await client.responses.create({
model: "some-model",
input: "Classify this lead.",
});
That's application-level code, no different in kind from calling any other third-party API. Knowing how to call it is genuinely useful; it's how the Smart Inbox feature I built into Formgrid works, sending a submission's text to Gemini Flash and getting a structured category and priority back. But knowing how to call an API isn't, by itself, deep AI engineering knowledge, any more than knowing how to call Stripe's API makes someone a payments engineer. The depth is in everything around that call.
What actually happens when you send a prompt
A simplified but accurate version of the pipeline:
Your text
↓
Tokenization
↓
Token IDs
↓
Numerical representations
↓
Transformer
↓
Attention + neural network operations
↓
Logits
↓
Probabilities/token selection
↓
Next token
↓
Repeat
↓
Output text
Your text gets broken into tokens, converted into numbers, and run through a transformer architecture that uses attention (a mechanism for weighing which earlier tokens matter most for predicting the next one) to produce a probability distribution over what token should come next. One token gets selected, gets appended to the sequence, and the whole process repeats to generate the token after that. This isn't magic, and it isn't mysterious; it's a lot of matrix math applied repeatedly, but you don't need to derive the math to reason well about the systems you build on top of it.
Tokens
A token is the actual unit a model processes, and it's not the same thing as a word. Common words might be a single token. Longer or less common words often split into several tokens. Punctuation and spaces can be their own tokens too. Exactly how text splits into tokens depends on the specific tokenizer a model uses; it isn't universal across providers.
Text
↓
Tokenizer
↓
Tokens
↓
Token IDs
The commonly cited approximations, roughly three-quarters of a word per token, or roughly four characters per token, are just that: rough approximations, not a conversion rate you should build precise logic around.
Why tokens matter for SaaS economics
Every request to a model consumes input tokens (what you send) and output tokens (what it generates), and providers usually price these two differently.
Input tokens
+
Output tokens
=
Token usage
Say, purely for illustration, a provider charged for 1,000 input tokens and 200 output tokens on a given call. Since actual pricing varies by model and provider and changes over time, any specific numbers here are just for showing the shape of the calculation, not something to copy into a cost model.
The shape of the request matters a lot. A cheap AI operation looks like this:
Lead submission
↓
Classification
↓
"High intent"
Small input, tiny output; this is close to what the Smart Inbox does: read a submission, return a category, a priority, and a summary. A more expensive operation looks like this instead:
Lead submission
↓
Large context
↓
Long reasoning/generation
↓
500-word personalized response
Same starting point, far more output and context, and therefore a meaningfully different cost profile. Designing an AI feature is partly a unit economics problem: what you're asking the model to read and produce directly shapes what the feature costs to run at scale, which is exactly the kind of thing that matters once a feature has real users instead of a demo audience.
Context windows
A context window is the amount of tokenized information a model can process within a single inference request. You can think of it loosely as working memory, though technically it's the model's available context for that one request, not a persistent memory of anything.
What can occupy that context:
System instructions
+
Conversation history
+
User message
+
Documents
+
Retrieved information
+
Tool results
The context window is measured in tokens, and it covers both what you send in and what the model generates back, subject to whatever specific limits a given model and API impose. It's not that the model "remembers" everything you've ever sent it; it's that everything relevant has to be included again, explicitly, in each request that needs it.
Context versus memory
These get conflated constantly, and the distinction matters for anything beyond a single request.
Context is information available to the model during the current inference call, and only that call.
Memory is information stored externally, in a database or a product's own memory system, and deliberately retrieved and re-added to context later, when it's relevant again.
User information
↓
Database/memory store
↓
Retrieve when relevant
↓
Context
↓
LLM
Any application that needs to "remember" something across sessions is building memory as a feature, on top of the model, not getting it for free from the model itself.
Why context windows matter in practice
A short legal contract might fit entirely inside a model's context window, letting it process the whole thing directly. A much longer document usually can't, or shouldn't, which is exactly the situation that pushes toward chunking and retrieval instead of dumping everything in at once:
Huge document
↓
Chunking
↓
Retrieval
↓
Relevant sections
↓
LLM
The same tension shows up with large codebases: a bigger context window lets you supply more code, but simply pasting an entire repository into context isn't automatically good architecture, and with long-running conversations, you need an actual strategy: summarization, truncation, retrieval, external memory, or some mix of them, rather than letting the transcript grow forever.
Bigger context is not automatically better
Worth stating explicitly, since it's an easy trap:
Larger context ≠ automatically better AI
More context you don't need costs more, adds latency, dilutes the model's attention with irrelevant information, and burns computation for no benefit. The actual engineering principle is narrower and more useful: give the model the information it needs for this specific task, not everything you happen to have lying around. That principle is exactly what leads naturally into retrieval.
Embeddings, briefly
An embedding is a numerical representation that lets software work with the semantic relationship between pieces of text, not just their literal wording.
"I want to buy a car."
↓
embedding
↓
[0.12, -0.43, 0.81, ...]
A sentence with different wording but a similar meaning produces a similar vector:
"I'm looking to purchase an automobile."
↓
embedding
↓
[a similarly shaped vector]
Embeddings power semantic search, document retrieval, recommendations, clustering, and RAG. Worth being precise here: an embedding is a learned numerical pattern useful for measuring similarity and relationships, not a literal, human-readable encoding of "meaning" the way a dictionary definition is.
RAG, in outline
RAG stands for retrieval-augmented generation.
Documents
↓
Chunking
↓
Embeddings
↓
Vector database
↓
User question
↓
Retrieve relevant information
↓
Add relevant information to context
↓
LLM
↓
Answer
The idea RAG solves: a model doesn't need every document you own sitting in its context for every question. Instead, the application retrieves just the pieces relevant to the current question and adds only those to the prompt. It's one of the most common patterns in production AI systems, and it's worth knowing clearly that RAG improves the odds of a grounded, factual answer; it doesn't eliminate hallucination outright. A retrieved passage can still be misread or misapplied by the model generating from it. The deeper mechanics, chunking strategy, reranking, choosing a vector database, are enough material for their own dedicated piece rather than a paragraph here.
AI applications are more than an LLM call
A simple wrapper looks like this:
User
↓
Prompt
↓
LLM API
↓
Response
That's a legitimate, useful way to prototype an idea fast. A production system usually looks considerably more like this:
User
↓
Application
↓
Authentication
↓
Input validation
↓
Context retrieval
↓
RAG
↓
Model routing
↓
LLM
↓
Tool calls
↓
Output validation
↓
Business logic
↓
Database
↓
Response
↓
Evaluation/observability
This is where most of what actually counts as AI engineering happens, and it's also the part that looks the most like ordinary backend engineering: auth, validation, routing, persistence, observability, all familiar, just with a model call somewhere in the middle of the flow instead of a plain database query.
Agents
An agentic system combines a model with tools, some state, a set of instructions, and a loop that lets it act, observe the result, and decide what to do next.
LLM
+
Tools
+
State
+
Instructions
+
Execution loop
For example, a user asks: "Find my unpaid invoices and email the oldest customer."
User:
"Find my unpaid invoices and email the oldest customer."
↓
AI Agent
/ \
↓ ↓
getInvoices() sendEmail()
The important detail: the model can request that a tool be called; it doesn't directly execute anything itself. Your application decides whether that request is actually allowed and executes it, or doesn't. Authorization and security stay entirely under application control, exactly as they would for any user-initiated action, never delegated to the model's judgment about what it should be allowed to do.
Evaluation
A question a lot of people building AI features skip past: how do you actually know your AI system works, beyond it feeling right in a few manual tests?
Test cases
↓
AI system
↓
Expected vs actual
↓
Evaluation
This covers evaluation datasets, accuracy metrics where they apply, hallucination checks, retrieval quality, tool call success rates, regression testing across prompt or model changes, and human review where automated evaluation isn't enough. Changing a prompt, or swapping to a newer model, can silently make a system worse in ways that never show up until a real user hits the case you didn't test. Evaluation is what catches that before your users do.
AI security
A short but important list: prompt injection, data leakage, tool authorization boundaries, sensitive information exposure, untrusted content making its way into a prompt, and agents with more permission than the task actually requires.
The governing principle: never treat a model's output as inherently trustworthy.
LLM says:
"Delete the account."
Application:
"Does this user actually have permission?"
The application enforces authorization independently, every time, regardless of what the model suggests or requests. A model's output is an input to your business logic, not a substitute for it.
Cost optimization
The real levers, roughly in order of how often they matter:
Model selection
Context size
Token usage
Caching
Model routing
Batching
Smaller models
Prompt caching
Efficient inference
The habit worth building is reasoning in three dimensions at once, quality, latency, and cost, rather than defaulting to "use the biggest, most capable model available." That's exactly the reasoning behind picking Gemini Flash for Formgrid's classification feature: a six-category classification with a summary doesn't need a frontier model's full reasoning capability, and paying for that capability on every single form submission, indefinitely, at scale, would have been a real, ongoing cost with no corresponding benefit to the actual task.
Do JavaScript developers need Python?
Not to get started, no. TypeScript and Node.js are genuinely capable of building production AI applications: APIs, orchestration, agents, streaming responses, and the surrounding SaaS infrastructure all work fine in the ecosystem you already know.
Python matters more once you're working closer to the model itself: PyTorch, Hugging Face, dataset preparation, fine-tuning, research tooling, and a large share of the open-source ML ecosystem live there and don't have equivalents as mature in JavaScript. The honest recommendation: keep TypeScript as your primary strength, and learn enough Python to be comfortable reading and adapting code in that ecosystem when you need to, not to switch your whole practice over to it.
How much math do you actually need?
Depends which side of the earlier spectrum you're aiming at.
Building AI applications well benefits from a practical grasp of vectors, embeddings, basic probability, similarity, basic statistics, and a conceptual understanding of what attention and neural networks are doing, enough to reason about behavior, not enough to derive it from scratch.
Deep ML engineering or research requires meaningfully more: real linear algebra, calculus, probability and statistics at depth, optimization theory, and numerical methods.
You don't need to become a mathematician to build good AI applications. You do need to understand the concepts well enough that you're reasoning about a system, not treating it as a black box that occasionally does something surprising for no traceable reason.
What to actually learn, in order
1. LLM fundamentals
↓
2. Tokens
↓
3. Context windows
↓
4. Embeddings
↓
5. Vector search
↓
6. RAG
↓
7. Structured outputs
↓
8. Tool/function calling
↓
9. Agents
↓
10. Evaluation
↓
11. AI security
↓
12. Observability
↓
13. Cost optimization
↓
14. Fine-tuning
↓
15. Open source models
↓
16. Model serving/inference
↓
17. Production AI architecture
Alongside that list, layered in over time rather than upfront: enough Python to navigate the ecosystem, ML fundamentals, and basic linear algebra and probability. The first twelve or thirteen items on that list are genuinely learnable by building things. Fine-tuning, model serving, and inference optimization are where things start requiring more specialized, ML-adjacent knowledge, and they're reasonable to treat as later, not first.
Projects worth building while learning
An AI lead classifier. Form submission goes in, an LLM call returns a structured classification, and it gets stored. This teaches tokens, structured outputs, model selection, evaluation, and cost, in a scope small enough to actually finish. It's also, not coincidentally, close to what Formgrid's Smart Inbox already does in production.
A document Q&A tool. Documents get embedded, stored in a vector database, retrieved based on a user's question, and fed to an LLM alongside that question to generate a grounded answer. This teaches embeddings, vector search, RAG, context management, and citing sources correctly.
A small AI agent. A user gives an instruction, an agent decides which tools to call, calls real APIs, and reports back. This teaches tool calling, state management, permission boundaries, agent loops, and evaluation of a much less predictable system than a single classification call.
An AI cost optimizer. Take an existing AI feature and work on model routing, caching, and token usage to bring the cost down without hurting quality. This teaches the quality, latency, and cost tradeoff directly, which is a different skill from building the feature in the first place.
Treat these as real, extendable projects rather than disposable tutorials, the same way Formgrid started as a project before it became a product with paying customers.
What an AI engineer can actually build
AI document processing platforms, AI customer support systems, AI sales operations tooling, contract management, accounts payable automation, research tools, data analysis systems, workflow automation, developer tools, lead intelligence platforms, and AI-native vertical SaaS products aimed at a specific industry's actual workflow.
The opportunity here isn't "build another chatbot." It's using a model to meaningfully automate or improve a workflow a business already has and already pays to run less efficiently today.
The mental model to leave with
AI APPLICATION
│
┌───────────────┼────────────────┐
↓ ↓ ↓
Data Models Tools
│ │ │
↓ ↓ ↓
Retrieval LLM APIs/actions
│ │ │
└───────────────┼────────────────┘
↓
AI SYSTEM
│
┌────────┼────────┐
↓ ↓ ↓
Evaluate Secure Optimize
│ │ │
└────────┼────────┘
↓
REAL PRODUCT
An AI engineer isn't simply someone who knows how to call an LLM API. It's someone who understands enough about models, data, context, retrieval, tools, evaluation, security, and infrastructure to build AI systems that hold up once real users and real load show up, not just in a demo.
That said, calling APIs well is still a real, necessary skill, not a lesser one. The difference between that and the rest of this list is depth of understanding and the ability to engineer the whole system around the call, not just the call itself. If you're a JavaScript developer starting from here, you already have most of what the systems half of that sentence requires. The model half is genuinely learnable, in the order laid out above, one real project at a time.
If you're working through this same map yourself, I'd like to hear what you're building. Reach me at allen@formgrid.dev.
I'm Allen, a full-stack TypeScript engineer and the founder of Formgrid and SheetRocket. I write about real production engineering from products that people actually pay for. More at jonesstack.com.
Top comments (0)