AI engineering sits between foundation models and product engineering. The day-to-day work behind useful LLM systems is prompts, RAG, tools, evals, serving, and lightweight adaptation.
Foundation models become working product features through AI engineering. The engineers doing that work usually don't train the frontier model from scratch. They connect it to product data, define tool contracts, control latency and cost, build evals, and make failures observable.
Think about an account-support assistant. The model alone can't know live account status, can't decide which policy document the user may see, and can't safely call billing APIs without guardrails. The AI engineer designs that path: retrieve allowed evidence, call approved tools, validate output, measure quality, and keep the feature inside budget.
That's the role in one sentence: build reliable software around probabilistic models.
Before foundation-model APIs and strong open-weight models became practical, many AI product efforts centered on collecting data, training a model, and deploying that model. That work still matters, but many product teams can now start with a capable hosted or open-weight model and spend most engineering effort on the surrounding system.
Swyx popularized the "AI Engineer" framing in 2023 as applied AI work moved toward software built on foundation models.[1] The term stuck because it names a real ownership boundary. The model is a component. The product is the deliverable.
A useful distinction: data scientists usually ship analysis and decisions, ML engineers usually ship trained or deployed models, and AI engineers usually ship model-backed product workflows. Their question is, "Can this feature solve the user's problem safely, cheaply, and measurably?"
The roles overlap. A strong AI engineer still needs statistics, software engineering, and model intuition. Day-to-day work lands in different places.
| Role emphasis | Primary output | Typical ownership question |
|---|---|---|
| Data science | Analysis, experiments, and decision support | Does the evidence support this decision? |
| ML engineering | Trained models and production ML pipelines | Can this model train, deploy, and stay reliable? |
| AI engineering | Model-backed product workflows | Can this feature use models safely, cheaply, and measurably? |
Scope rule: Titles overlap. Compare the artifact and ownership boundary in a job description before deciding which skill set it rewards.
Most AI engineering work falls into six connected areas.
Prompting isn't "asking nicely." It's the contract between product logic and model behavior. AI engineers write system instructions, examples, tool descriptions, and output schemas so model responses can be used by normal software.
Structured outputs matter because downstream code needs typed fields, not vibes. If a model extracts account_status, next_action, and confidence, the backend needs to validate those fields before rendering or calling another service.[2]
Failure mode: a prompt works in a notebook, then production users send weird inputs and JSON parsing breaks. Use a schema, validation, retries with bounded repair, and tests that include messy examples.
Retrieval-augmented generation (RAG) gives the model relevant external evidence at answer time. Demo RAG can be a PDF folder and a vector database. Production RAG needs parsing, chunking, embedding, exact-match search, permissions, reranking, and evals.
Dense retrieval helps with semantic matches. BM25 protects exact terms such as product names, error codes, and IDs.[3][4] Many serious systems use hybrid retrieval because users mix fuzzy language with exact identifiers.
Security is part of retrieval, not an afterthought. If private chunks enter the prompt, the model has already seen them. Guardrails after generation can't undo that. AI engineers store access metadata with chunks and test that forbidden documents never reach context assembly.
Agents are model-driven loops that can call tools: search, database lookup, code execution, ticket creation, or API calls. Control is the difficult part. The model proposes actions; software decides what tools exist, what parameters are valid, what permissions apply, and when to stop.
ReAct is useful when tool output should change the next step.[5] Plan-and-Execute works better when the workflow has a stable structure. Model Context Protocol (MCP) matters because it standardizes how tools and resources are exposed to AI clients. Anthropic's 2025 donation announcement says it donated MCP to the Linux Foundation and co-founded the Agentic AI Foundation (AAIF) with Block and OpenAI.[6]
Failure mode: the agent loops forever, calls a nonexistent tool, or takes a side effect without enough evidence. Use schema validation, max-iteration limits, allowlists, permission checks, idempotency, and human review for risky actions.
Every large language model (LLM) feature has a cost and latency shape. Provider APIs usually bill by input, cached input, and output tokens, so prompt length and response length directly affect spend.[7] Self-hosting adds GPU memory, batching, scheduling, routing, and cache pressure.
The KV cache is often the serving bottleneck because it stores attention state for previous tokens and grows with sequence length and concurrency. PagedAttention stores KV cache in fixed-size blocks to reduce fragmentation, while vLLM, SGLang, TensorRT-LLM, TGI, and llama.cpp make different serving trade-offs.[8][9][10][11][12]
Failure mode: the feature is accurate but too slow or too expensive. The fix might be shorter context, prompt caching, semantic caching, model routing, quantization, batching, or a smaller model on easy requests.
Prompting and RAG should usually come first. Sometimes they stop improving the metric. Then model adaptation becomes reasonable.
AI engineers are more likely to use LoRA, QLoRA (quantized LoRA), instruction data curation, synthetic examples, and adapter rollout than full pretraining.[13][14] The decision question is practical: is the failure about missing facts, unstable behavior, format adherence, or domain style?
Fresh facts usually belong in RAG. Durable behavior can justify tuning. Format problems may be better solved with structured output before any weight update.
This is the biggest difference between demos and products. An AI engineer needs to answer, "Did the change make quality better, worse, or just different?"
That usually means a golden dataset, deterministic checks where possible, LLM-as-judge where needed, human calibration for the judge, and release gates that catch regressions. Benchmarks such as MMLU, HumanEval, and SWE-bench are useful context, but they rarely replace your product evals.[15][16][17]
Common mistake: spot-check ten examples and ship. Better pattern: collect real user cases, label expected behavior, run them every time the prompt, retrieval config, model, or tool loop changes, and inspect failures before rollout.
Evaluation rule: Public benchmarks describe a model or scaffold under one protocol. Product release decisions need task-local cases, failure labels, and a regression threshold.
At a startup, one engineer may own the whole loop: reproduce a bad answer, trace retrieval, update prompts, compare embedding models, expand the eval set, deploy, and watch spend.
At a larger product company, the path is more structured: product goal, model contract, RAG or tool path, eval suite, backend integration, A/B test, and production monitoring.
At a frontier AI lab or AI infrastructure company, the scope is narrower and deeper: tool-use infrastructure, eval platforms, model-serving systems, data pipelines, or post-training workflows. The work may look closer to systems engineering or ML infrastructure than product feature work.
Job titles hide the real boundary. Follow one artifact from request to production to see what the AI engineer owns.
Product asks for answers grounded in account policy. The AI engineer turns that request into a retrieval and response contract: allowed document scopes, required citations, refusal behavior, latency budget, and an eval set with answerable and unanswerable cases.
The work crosses several layers. Ingestion must preserve document version and access metadata. Retrieval must filter before ranking. Prompt assembly must fit the evidence budget. The response schema must distinguish answer, citation, and abstention. Release checks must catch unsupported answers and permission leaks.
Completion isn't "the chatbot answered my test question." Completion means the service passes retrieval and answer evals, forbidden documents never enter model context, traces expose failures, and a rollback path exists.
Suppose an assistant may create a support ticket. The model can propose create_ticket, but trusted application code owns authorization, schema validation, idempotency, rate limits, and execution. The AI engineer defines that boundary and tests it with duplicate requests, missing fields, unauthorized users, and tool timeouts.
A polished natural-language response can't compensate for a duplicated side effect. Success requires the correct ticket state, a durable action receipt, and a response that reflects what the tool actually returned.
A team wants to send easy requests to a smaller model. The AI engineer defines the routing signal, fallback path, quality threshold, latency and cost metrics, and evaluation slices. They also test low-confidence cases and provider failures.
The router ships only when the smaller path preserves required quality and the fallback contains failures. Average latency alone can hide a bad tail or a weak slice, so acceptance criteria include per-route quality and fallback rate.
Tool names change quickly. Stable categories matter more: model APIs such as OpenAI, Anthropic, Gemini, Mistral, and Groq; open-weight models such as Llama, Qwen, DeepSeek, Mistral, and Kimi; serving stacks such as vLLM, TensorRT-LLM, SGLang, TGI, and llama.cpp; retrieval systems such as Qdrant, Weaviate, Pinecone, and pgvector; orchestration with LangGraph, LlamaIndex, Haystack, or custom code; evaluation with Braintrust, LangSmith, or custom evals; and observability with OpenTelemetry, Helicone, or LangSmith.
Learn the concepts behind those names: pricing, rate limits, context windows, structured output, licenses, quantization, batching, KV cache, metadata filters, reranking, tool retries, judges, regression gates, traces, token spend, and failure analysis.
Default to boring technology when possible. A stack your team can debug at 2 a.m. beats a trendy abstraction nobody understands.
Take a support assistant that cites the wrong cancellation policy. Editing the prompt first is tempting, but the failure may have happened earlier.
Start from the trace and reconstruct one request:
If the correct policy never appeared in initial retrieval, prompt work can't recover it. Check parsing, chunk boundaries, metadata filters, hybrid search, and query rewriting. Add the failing request to retrieval evals before changing the index or retriever.
If retrieval found the correct policy but reranking dropped it, compare ranking features and score distributions. Fix or replace the reranker, then verify that unrelated query slices don't regress.
If correct evidence reached the model but the answer contradicted it, tighten the response contract, require claim-level citations, add an abstention path, or test another model. Keep the same evidence packet while comparing generation changes.
If the model response was correct but the user saw the wrong text, inspect parsing, caching, and frontend rendering. AI failures are often ordinary distributed-systems failures near a model call.
Finish with three artifacts: a regression case, a trace showing the repaired path, and a metric change over the relevant eval slice. Without those, the team has a plausible patch but no proof.
Titles vary, so judge roles by ownership. Junior and mid-level engineers usually own feature slices, prompt changes, eval harnesses, or simple RAG endpoints. Senior engineers own end-to-end systems and trade-offs across product, infrastructure, quality, and cost. Staff and principal engineers standardize shared platforms, governance, vendor strategy, and serving architecture. AI platform leaders own internal APIs, observability, security, and budget systems across teams.
Don't over-index on title. A "Software Engineer, AI" can own more real AI system surface area than an "AI Engineer" role that only tweaks prompts.
You already know production software. Add transformer fundamentals, one real RAG project with retrieval evals and citations, inference economics, one tool-using agent with permissions and stopping rules, and one eval suite that catches regressions.
Strong portfolio signal: "I found this failure, wrote this eval, shipped this fix, and moved this metric."
Your advantage is measurement: experimentation, labels, and statistical thinking map directly to evaluation work. Your gap is usually systems depth, so build APIs with typed code, observability, deployment practice, and backend integration skills.
Focus on proof. Build two or three small systems that show the whole loop: document QA over real docs with retrieval metrics and citations, a tool-using agent with a safe mock API and failure tests, or a model-routing/caching demo that compares cost, latency, and quality.
Write short technical notes about what broke. Clear failure analysis beats a polished demo video.
A portfolio project should prove an engineering loop beyond displaying a chat interface. Before calling a project complete, require evidence in five areas.
One strong project can satisfy these criteria without using every popular framework. Reviewers can inspect the contract, run the eval, reproduce a failure, and see how the system behaves when a dependency breaks.
If you're ready to start, the AI Engineering Curriculum begins with Git, shell, and Linux for reproducible AI work, then builds toward RAG, agents, evaluation, serving, and system design. Scaled dot-product attention comes later as a transformer deep dive.
The Rise of the AI Engineer.
swyx · 2023
Structured outputs
OpenAI · 2024
Dense Passage Retrieval for Open-Domain Question Answering.
Karpukhin, V., et al. · 2020 · EMNLP 2020
The Probabilistic Relevance Framework: BM25 and Beyond.
Robertson, S., & Zaragoza, H. · 2009 · Foundations and Trends in Information Retrieval
ReAct: Synergizing Reasoning and Acting in Language Models.
Yao, S., Zhao, J., Yu, D., Du, N., Shafran, I., Narasimhan, K., & Cao, Y. · 2023 · ICLR 2023
Donating the Model Context Protocol and establishing the Agentic AI Foundation
Anthropic · 2025
OpenAI API Pricing
OpenAI · 2026
Efficient Memory Management for Large Language Model Serving with PagedAttention
Kwon, W., et al. · 2023 · SOSP 2023
vLLM: Easy, Fast, and Cheap LLM Serving with PagedAttention
vLLM Team · 2024
SGLang: Efficient Execution of Structured Language Model Programs
Zheng, L., Yin, L., Xie, Z., et al. · 2023 · arXiv:2312.07104
TensorRT-LLM: A High-Performance Inference Framework for LLMs.
NVIDIA · 2024
llama.cpp: Inference of LLaMA model in pure C/C++
Gerganov, G. · 2023
LoRA: Low-Rank Adaptation of Large Language Models.
Hu, E. J., et al. · 2021 · ICLR
QLoRA: Efficient Finetuning of Quantized Language Models.
Dettmers, T., et al. · 2023 · NeurIPS
Measuring Massive Multitask Language Understanding (MMLU).
Hendrycks, D., et al. · 2021 · ICLR 2021
Evaluating Large Language Models Trained on Code (HumanEval).
Chen, M., et al. · 2021 · arXiv preprint
SWE-bench: Can Language Models Resolve Real-World GitHub Issues?.
Jimenez, C. E., et al. · 2024 · ICLR 2024