# Keras 3 and its four backends: what the multi-backend design does and does not let you do

> Keras 3 wraps JAX, TensorFlow, PyTorch, and OpenVINO behind one modeling API. The abstraction is convenient, but backend selection locks in at import, OpenVINO only predicts, and the default install is CPU only.

**keras-team/keras** — Multi-backend deep learning framework that runs the same high-level API on JAX, TensorFlow, or PyTorch, scaling from a laptop to clusters of GPUs and TPUs.

- Repository: https://github.com/keras-team/keras
- Website: http://keras.io/
- Stars: 64,344 · Forks: 19,807
- Language: Python
- License: Apache-2.0
- Published: 2026-08-04 · Updated: 2026-08-18 · Language: en
- Canonical page: https://hysenlabs.com/projects/keras-team-keras

## Four runtimes behind one Keras API

Keras 3 is a multi-backend deep learning framework. It supports JAX, TensorFlow, PyTorch, and OpenVINO, with OpenVINO limited to inference only. You write the model, layers, and training loop once in the Keras API, and Keras drives whichever runtime you selected underneath. Keras 3 installs from PyPI as the keras package:
```bash
pip install keras --upgrade
```
The project frames the multi-backend design as a way to avoid framework lock-in, so the same high-level workflow can run on the scalability and performance of JAX or the production ecosystem options of TensorFlow. The stated performance claim is speedups ranging from 20% to 350% compared to other frameworks, achieved by choosing the backend that is fastest for your model architecture, often JAX, with a benchmark page on keras.io. Keras also lets you step below the high-level API: a Keras model can be trained in a loop written from scratch in native TF, JAX, or PyTorch, and it can be used as part of a PyTorch-native Module or a JAX-native model function. The abstraction is a starting point, not a walled garden.

## The backend locks in the moment you import keras

Selecting a backend is not something you can change later in the same process. The backend must be configured before importing keras, and once the package has been imported, the backend cannot be changed. You configure it by exporting the environment variable KERAS_BACKEND or by editing your local config file at ~/.keras/keras.json. The available options are tensorflow, jax, torch, and openvino. In a notebook you set it in a cell before the import:
```python
import os
os.environ["KERAS_BACKEND"] = "jax"

import keras
```
or in a shell:
```bash
export KERAS_BACKEND="jax"
```
The consequence for readers is concrete: if you want to compare two backends in one experiment, a notebook, or a test suite, you cannot flip a variable and reload. You have to start a fresh process, one environment per backend, with the variable set before the first import. Forgetting to set it before the import means the library picks a default and keeps it for the life of the process. This ordering constraint is the main thing to get right when you wire Keras into an existing codebase.

## OpenVINO predicts and cannot train

The fourth backend, openvino, is inference only. It is designed only for running model predictions using the model.predict() method. It is not a training backend, so if you pick openvino as your KERAS_BACKEND, you can load a model and call predict on it, but you cannot use that backend to fit a model, run a training loop, or optimize anything. This has a direct consequence: openvino is a deployment and serving target, not a development environment. The minimum supported OpenVINO version is 2026.2.0. For a reader who wants one codebase to both train and serve, openvino covers only the serving half, so training happens on tensorflow, jax, or torch and openvino handles prediction. If you are choosing a backend purely for experimentation, this option is not the one you want. Nothing in the dependency list makes OpenVINO a full peer of the other three runtimes.

## The default requirements install is CPU only

The requirements.txt used for local development installs CPU only builds of TensorFlow, JAX, and PyTorch. GPU support is not in that file by default. For GPU, the project provides separate requirements files per backend: requirements-tensorflow-cuda.txt, requirements-jax-cuda.txt, and requirements-torch-cuda.txt. These install all CUDA dependencies via pip and expect an NVIDIA driver to be pre-installed. The project recommends a clean Python environment for each backend to avoid CUDA version mismatches. The documented way to build a JAX GPU environment with conda is:
```shell
conda create -y -n keras-jax python=3.10
conda activate keras-jax
pip install -r requirements-jax-cuda.txt
python pip_build.py --install
```
The consequence for readers: if you run the default requirements install and expect GPU acceleration, you end up on CPU without an obvious error. Trying to keep several GPU backends in one shared conda environment is the exact situation the project warns against, because CUDA version conflicts surface as import errors deep in the stack. Separate environments per backend is the safe pattern.

## Windows is supported through WSL2, not natively

Keras 3 is compatible with Linux and macOS. For Windows, the project recommends running Keras under WSL2, so native Windows is not the supported path and a Windows user needs the Windows Subsystem for Linux. There is also a platform split baked into the dependency file. In requirements.txt, TensorFlow is installed as tensorflow-cpu on platforms that are not darwin, and as full tensorflow on darwin:
```bash
tensorflow-cpu;sys_platform != 'darwin'
tensorflow;sys_platform == 'darwin'
```
So macOS and Linux do not get the same TensorFlow build from the same requirements file. The practical consequence for readers: if you are on Windows and follow a Linux or macOS tutorial verbatim, pip may fail to find a matching wheel, or the installed backend may not behave as the tutorial assumes, because the project expects you to be inside WSL2. This is a limitation the project names directly rather than something you discover after training starts.

## The .keras save format is the one snag in a tf.keras port

Keras 3 is intended to be a drop-in replacement for tf.keras when you use the TensorFlow backend. The migration path is short: take your existing tf.keras code, make sure your calls to model.save() use the up-to-date .keras format, and you are done. That .keras save format is the one real snag. If your model has no custom components, you can start running it on top of JAX or PyTorch immediately. If it does have custom components, such as custom layers or a custom train_step(), it is usually possible to convert it to a backend-agnostic implementation in just a few minutes. The consequence: a codebase that only used stock layers and saved in the older format can switch backends cheaply, but one that has hand-written layers or a custom train_step has a real porting task, and the older on-disk format has to be rewritten. Separately, Keras models can consume datasets in any format regardless of backend, so you can keep tf.data.Dataset pipelines or PyTorch DataLoaders as they are.

## CPU and GPU run different JAX pins in CI

The dependency file shows how the project balances backends in one repository. JAX is pinned to 0.8.0 on CPU for CI compatibility with older backends, and the file notes they test against the latest JAX on GPU, so the CPU test environment deliberately runs an older JAX than the GPU one. There is a coupling to keep in mind: when the version of TensorFlow is changed, the version of tf_keras must be changed in .github/workflows/actions.yml as well, installed with pip install --no-deps tf_keras. Because Keras 2 lives on as the tf-keras package, the two have to be version-aligned in CI. The backend compatibility table lists minimum supported versions for the latest stable v3.x release: TensorFlow 2.16.1, JAX 0.4.20, PyTorch 2.1.0, and OpenVINO 2026.2.0. So a runtime older than these minimums is out of support, and the package itself requires Python 3.11 or newer, with classifiers listing 3.11 and 3.12. The consequence for readers on older stacks: check these minimums before you start, because an environment pinned below them is not a supported combination.

## Conclusion

Keras 3 suits teams that want one high-level modeling API and the freedom to pick or switch the runtime, and it suits existing tf.keras codebases willing to move saves to the .keras format. It is a poor fit if you need native Windows without WSL2, if you want OpenVINO to train as well as predict, or if you expect to swap backends inside a single running process. Before committing, confirm your runtime clears the listed minimums, install the matching CUDA requirements file for GPU work, and set KERAS_BACKEND before the first keras import.

## FAQ

### What is Keras vs TensorFlow?

Keras 3 is a multi-backend deep learning framework that supports JAX, TensorFlow, PyTorch, and OpenVINO, and it can act as a drop-in replacement for tf.keras when the TensorFlow backend is in use.

### What is Keras used for?

It is used to build and train models for computer vision, natural language processing, audio processing, timeseries forecasting, recommender systems, and similar tasks.

### What is Keras vs PyTorch?

Keras 3 runs on PyTorch as one of its backends, with a minimum supported PyTorch version of 2.1.0, and a Keras model can be used as part of a PyTorch-native Module.

### how to install keras

Run pip install keras --upgrade to get Keras 3 from PyPI, and also install a backend package such as tensorflow, jax, or torch. The openvino backend is supported for inference only.

### how to install keras and tensorflow

Install keras with pip install keras --upgrade, then install tensorflow as the backend package. With the TensorFlow backend, Keras 3 is meant as a drop-in replacement for tf.keras using the .keras save format.

## Sources

- [Official documentation](http://keras.io/)
- [Official README](https://github.com/keras-team/keras#readme)
- [Project repository](https://github.com/keras-team/keras)
- [Release notes](https://github.com/keras-team/keras/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/keras-team-keras
