Keras: What It Is, How It Works, and How to Use It in 2026

Keras is a deep learning API written in Python, and since late 2023 it no longer belongs to one framework: the same Keras code can now run on top of TensorFlow, JAX, or PyTorch, chosen at will rather than fixed at install time. Its own documentation puts the value proposition plainly: “As a multi-framework API, Keras can be used to develop modular components that are compatible with any framework.” Keras.io lists NASA, YouTube, and Waymo among the organizations using it, and the project’s README claims nearly three million developers.
This guide replaces an earlier version of this page that had drifted into inaccuracy — a wrong creator name, a wrong release year, and code samples that wouldn’t run. Every fact below is checked against Keras’s own documentation, its GitHub repository, and Wikipedia’s sourced entry; every code sample is copied from Keras’s own “first contact” guide rather than reconstructed from memory.
Who actually built it, and when
Keras was released on 27 March 2015 by François Chollet, then a Google engineer, as part of a research effort called ONEIROS (Open-ended Neuro-Electronic Intelligent Robot Operating System). The name itself comes from the Ancient Greek κέρας (keras), meaning “horn” — a reference to a passage in the Odyssey distinguishing true dreams, which pass through a gate of horn, from false ones, which pass through a gate of ivory.
Chollet is also the author of the Xception architecture — a paper with more than 18,000 citations — and of the widely used book Deep Learning with Python. He left Google in November 2024 after more than nine years there, and co-founded a new startup with Zapier co-founder Mike Knoop focused on artificial general intelligence through program synthesis. Along the way, in 2019 he published the ARC-AGI benchmark for testing novel reasoning in AI systems, and in 2024 launched ARC Prize, a $1 million competition built around it, which became a non-profit foundation in early 2025. None of that is Keras news exactly, but it answers the question every “what happened to X” search eventually asks: Chollet still runs the project, and Keras is not an abandoned or acquihired library.
The backend history, corrected
The most commonly repeated error about Keras is timing its relationship with TensorFlow. Here’s the actual sequence:
| Period | What Keras supported |
|---|---|
| 2015 – v2.3 | Multiple backends: TensorFlow, Theano, Microsoft Cognitive Toolkit (CNTK), and PlaidML |
| v2.4 – v3.0 (2020–2023) | TensorFlow only — the multi-backend design was dropped |
| v3.0 onward (November 2023) | Multi-backend again: TensorFlow, JAX, or PyTorch, plus OpenVINO for inference only |
Keras became TensorFlow’s bundled, official high-level API (as tf.keras) during the TensorFlow-only period, and Keras 3 has been the default tf.keras implementation from TensorFlow 2.16 onward — TensorFlow 2 itself shipped in September 2019. If you’ve read that Keras “became TensorFlow’s official API in 2017,” that predates both the TF 2.0 relaunch and today’s multi-backend Keras 3; treat any date without a version number attached to it with suspicion. Current stable release, as of this update, is 3.15.1.
Building a model: both APIs, correctly
The Sequential API is a linear stack of layers, and it’s the fastest way to get something running:
import keras
from keras import layers
model = keras.Sequential()
model.add(layers.Dense(units=64, activation="relu"))
model.add(layers.Dense(units=10, activation="softmax"))
For anything with multiple inputs, shared layers, or a non-linear graph of connections, the functional API gives you the same building blocks with explicit control over how they connect:
import keras
from keras import layers
inputs = keras.Input(shape=(100,))
x = layers.Dense(64, activation="relu")(inputs)
outputs = layers.Dense(10, activation="softmax")(x)
model = keras.Model(inputs=inputs, outputs=outputs)
Either way, the next steps are the same three calls. Compile, to attach a loss function, optimizer, and metrics:
model.compile(
loss="categorical_crossentropy",
optimizer="sgd",
metrics=["accuracy"],
)
Fit, to train on batches of your data:
model.fit(x_train, y_train, epochs=5, batch_size=32)
And evaluate, or predict, once training is done:
loss_and_metrics = model.evaluate(x_test, y_test, batch_size=128)
classes = model.predict(x_test, batch_size=128)
Keras’s own documentation frames this as “progressive disclosure of complexity”: the four calls above are the entire beginner path, and the same objects support arbitrarily more control when you need it — a custom optimizer with explicit learning rate and momentum, a hand-written training loop, or a subclassed layer with its own call() method that runs unmodified on any of the three backends.
What actually changed in Keras 3, measured
Anthropic didn’t build Keras 3 — Google’s Keras team did, and they published their own benchmark comparing Keras 2 (TensorFlow-only) against Keras 3 running on each of its three backends. The setup: a single NVIDIA A100 GPU, popular vision and language models, milliseconds per training or inference step, averaged over 100 steps.
| Model, task | Keras 2 (TensorFlow) | Keras 3 (TensorFlow) | Keras 3 (JAX) |
|---|---|---|---|
| BERT, training | 486.00 ms | 214.49 ms | 222.37 ms |
| SegmentAnything, inference | 1,859.27 ms | 438.50 ms | 376.34 ms |
| Stable Diffusion, training | 1,023.21 ms | 392.24 ms | 391.21 ms |
That’s the same model code, the same hardware, and the same model.fit() call — Keras 3 on the same TensorFlow backend is 2.3× faster training BERT and 4.2× faster running SegmentAnything inference than Keras 2 was, before JAX or PyTorch even enter the comparison. The team’s own stated conclusion is worth keeping: “there’s no single backend that consistently outpaces the others. The fastest backend often depends on your specific model architecture.” JAX edges out TensorFlow on some tasks and loses on others; the point of Keras 3 isn’t that one backend wins, it’s that you can find out and switch without rewriting your model.
Switching backends is one environment variable, set before Keras is ever imported:
export KERAS_BACKEND="jax"
import os
os.environ["KERAS_BACKEND"] = "jax"
import keras # backend is locked in at import time
The PyTorch backend in that benchmark trails badly on the LLM rows — Keras’s own footnote explains why: “LLM inference with the PyTorch backend is abnormally slow at this time because KerasHub uses static sequence padding, unlike HuggingFace.” That’s a real, named limitation as of this writing, not a general verdict on PyTorch — it’s specific to text generation through KerasHub’s current implementation.
The ecosystem beyond the core library
“Keras” today names a family of libraries, not one package:
- KerasHub — pretrained model architectures and checkpoints for text, image, and audio, usable across all three backends
- KerasRS (Keras Recommenders) — building blocks for recommender systems
- KerasTuner — hyperparameter search with Bayesian optimization, Hyperband, and random search built in
- AutoKeras, built by Texas A&M’s DATA Lab — an AutoML layer on top of Keras aimed at making model search accessible without hand-tuning architectures
If you’ve only used keras.layers.Dense and model.fit(), the tuning and pretrained-model layers are the parts most worth exploring next — they solve “which architecture” and “which hyperparameters” rather than “how do I wire up layers,” which is a different problem than the core API addresses.
Where Keras is actually used
The applications below are real and current, trimmed from a longer, vaguer original list:
- Computer vision: convolutional layers plus pretrained checkpoints (VGG, ResNet, and others, now largely served through KerasHub) make image classification and object detection a fine-tuning job rather than a from-scratch one. Medical imaging — diabetic retinopathy screening from retinal scans, tumor detection in pathology slides — is a widely cited applied case, because a pretrained vision backbone plus a modest labeled dataset is usually enough to get a useful classifier.
- NLP: recurrent layers (LSTM, GRU) for sequential text, alongside KerasHub’s transformer-based pretrained models for classification, translation, and generation. The functional API’s support for shared layers and multiple inputs matters more here than in vision — a lot of real NLP architectures aren’t simple stacks.
- Time series: recurrent and convolutional architectures for forecasting — demand forecasting, financial series, anomaly detection — where the task is predicting a continuous value forward in time rather than classifying a fixed input.
- Reinforcement learning: Keras models as the function approximator inside a DQN or policy-gradient method, commonly paired with an environment library like Gymnasium (the maintained successor to OpenAI Gym).
Keras vs. writing PyTorch or TensorFlow directly
The honest trade-off: Keras trades a little control for a lot less code, and Keras 3 removes the old cost of that trade — locking into one framework. Keras’s own framing is direct about the ecosystem argument: “If you implement it in pure TensorFlow or PyTorch, it will be usable by roughly half of the market. If you implement it in Keras, it is instantly usable by anyone regardless of their framework of choice.” A model built with Keras can be instantiated as a PyTorch Module, exported as a TensorFlow SavedModel, or used as a stateless JAX function — the same model definition, three ecosystems.
Where writing against a framework directly still wins: research code that needs a training loop unlike anything model.fit() anticipates, or a team already deep in one framework’s specific tooling with no reason to abstract it away. Keras’s subclassing API narrows that gap — a custom train_step() is one of the documented escape hatches — but it’s still an abstraction layer, and abstraction layers cost something even when the cost is small.
Frequently asked questions
Who created Keras, and when?
François Chollet, then a Google engineer, released it on 27 March 2015 as part of the ONEIROS research project.
Is Keras still just for TensorFlow?
No, and it hasn’t been since November 2023. Keras 3 runs on TensorFlow, JAX, or PyTorch, chosen with the KERAS_BACKEND environment variable before import. It was TensorFlow-only from version 2.4 through 3.0, which is the period most existing “how Keras works” content was written in and around.
What does “Keras 3” actually mean, practically?
A full rewrite of the library’s internals so the same high-level code — layers, models, fit(), compile() — runs unmodified on three different underlying frameworks, with framework-specific performance differences that Keras’s own benchmarks show can run either direction depending on the model.
Is Keras 3 backward-compatible with old tf.keras code?
Largely yes. Keras’s own guidance: if your model doesn’t use custom components, it should run on JAX or PyTorch immediately; if it does (custom layers, a custom train_step()), converting it to be backend-agnostic is usually a small job, not a rewrite.
What is François Chollet doing now?
He left Google in November 2024 and co-founded a startup focused on artificial general intelligence through program synthesis, alongside running the ARC Prize, a benchmark and now non-profit foundation aimed at measuring genuine reasoning ability in AI systems.
Related
- PyTorch vs. TensorFlow Frameworks, the two frameworks Keras now sits on top of
- How to run an LLM locally with Ollama, for the inference side of a model once it’s trained
- Fine-tuning and transfer learning in the glossary
- Neural network and convolutional neural network (CNN)