AI on the web: key concepts for developers
Artificial intelligence (AI) refers to non-human programs, models, or computers that perform a broad range of problem-solving and creative tasks that traditionally required human input. The term "AI" is often applied loosely across different technologies in this space, but capabilities vary significantly. For web developers, AI can now generate new content, make predictions, and automate tasks that previously required explicit programming.
Understanding a few core concepts helps clarify how AI fits into web development:
- Training: The first step in building a model is gathering data, cleaning it, and organizing it. Machine learning engineers then build an algorithm and provide specific inputs with desired outputs to train the model. As a rule, web developers don't need to perform model training, but should know how a given model was trained. While fine-tuning is possible, choosing the right pre-trained model is generally more effective.
- Inference: This is the process of a model drawing conclusions from new data. More training increases the likelihood of useful, correct outputs, but there's no guarantee of perfect inference regardless of model maturity. For example, Google's Green Light uses AI trained on Google Maps data to understand traffic patterns and recommend traffic light optimizations based on ongoing inference.
Where AI runs: client, server, or both
Training happens before a model is released, with further training producing new model versions. For web development, the location of inference matters most — it drives both cost and capability.
Client-side AI
Most AI features on the web rely on servers, but client-side AI performs inference directly in the user's browser. This offers lower latency, reduced server-side costs, no API key requirements, improved user privacy, and offline access. It can also outperform larger server models when optimized properly. Tools like Transformers.js, TensorFlow.js, and MediaPipe enable cross-browser client-side AI implementations.
Server-side AI
Server-side AI covers cloud-based services such as Gemini 1.5 Pro. These models are generally larger and more powerful, particularly large language models, but inherit the tradeoffs of a remote dependency.
Hybrid AI
Hybrid AI combines both client and server components. A typical pattern involves a client-side model handling easy tasks with a server-side fallback for more complex requests that exceed on-device capability.
Understanding model classifications
Machine learning (ML)
Machine learning is the process by which a computer learns to perform tasks without explicit programming. Where AI aims for intelligence in general, ML uses algorithms to make predictions from data. For instance, a weather rating tool might traditionally call on meteorologists to build a representation of the atmosphere; filling the tool with large amounts of weather data lets an ML model learn the mathematical relationships between patterns, historical context, and user ratings instead.
A foundation model is pre-trained at massive scale for a wide range of tasks, often developing emergent capabilities the model wasn't explicitly trained for. While foundation models are general-purpose and not task-specific, the same is not true in reverse — not every foundation model is an LLM.
A large language model (LLM) uses billions of parameters to generate, classify, or summarize text and images. Parameters are the weights and biases established during training. By contrast, a small language model (SLM) may have millions to billions of parameters — a broader range that is increasingly common in specialized deployments.
Generative AI and related techniques
Generative AI uses LLMs to create or modify text, images, video, and audio based on supplied context. It operates beyond pattern matching, producing content that mimics human creation. Chatbots like Gemini (Google), ChatGPT (OpenAI), Claude (Anthropic), and Copilot (Microsoft) have made generative AI a mainstream tool for everything from drafting written prose and planning vacations to classifying datasets and professionalizing emails. Pre-trained generative models are equally useful to developers and non-developers.
Deep learning (DL) is a subset of ML algorithms. Deep Neural Networks (DNNs) attempt to model how the human brain processes information. A deep learning algorithm may be trained to associate image features with labels, then predict new images by category — this is how Google Photos differentiates cats from dogs.
Natural language processing (NLP) is another class of ML focused on helping computers comprehend human language, including grammar rules, dialect, and slang.
AI's practical limitations
Awareness of risks protects your decisions as a developer building with AI:
Data quality and recency
Training datasets are frequently outdated by release time. Datasets can also be incomplete or too small for effective model performance. Prompt engineering sharpens a model's usefulness for newer or specific tasks and can help compensate for data deficiencies.
Ethics and bias
Models learn from data collected and interpreted by humans, so outputs can unknowingly reflect human bias and harmful stereotypes. Approaching your AI build with bias mitigation as a core requirement is essential. Copyright for AI-generated content also carries unresolved legal ambiguity — consider policies for your material before you rely on generated output.
Security and privacy
Privacy and security are high-ranking concerns among developers working with AI, especially under strict compliance demands such as healthcare or government. Cloud APIs expose more user data to third parties, which requires secure transmission and continuous monitoring. Client-side AI holds meaningful promise in this area, with active research still needed to bolster it for broader production use.
Start integrating AI
Once familiar with the model types, you can decide where pre-trained models make sense in your projects. That includes common tasks like:
- A search autocomplete with more relevant results
- Detecting common objects with a smart camera
- Filtering comment spam with a natural language model
- Improving code productivity through autocomplete
- WYSIWYG writing tools that suggest the next word or sentence
- Explaining and interpreting datasets for non-technical users
Pre-trained models frequently meet your needs without customization. When more specific behavior is needed, model tuning further trains a pre-trained model on your data. Key techniques:
- Reinforcement learning from Human Feedback (RLHF) uses human preferences to better align responses with intent.
- Low-Rank Adaption (LoRA) is a parameter-efficient method for LLM tuning, reducing the number of trainable parameters while preserving performance.



