# Keras

> Canonical: https://skillalmanac.com/glossary/keras | Last verified: 2026-11-24 | Index status: not offered to search engines

Keras is an open-source Python library for building and training artificial neural networks. Keras 3 runs on top of JAX, TensorFlow or PyTorch, and OpenVINO for inference only.

Also called: Keras library, Keras Python, Keras TensorFlow, Keras 3, Keras API.

## In plain language

Keras is a toolkit that lets a programmer describe a neural network as a stack of building blocks, then train it on data with a couple of commands. Think of it as a set of ready-made parts for a model, where the heavy number-crunching is done by another framework underneath. It is a library for people who write code, not an app or an AI assistant. Its limits are practical: you still have to supply data, choose settings and check the results, and training large models needs suitable hardware, which can cost money. Keras does not make a model accurate; it makes the model easier to write down.

## Technical definition

According to the Keras documentation, Keras 3 is a full rewrite that runs Keras workflows on JAX, TensorFlow or PyTorch, with OpenVINO available for inference only. Models are built with the Sequential API, the Functional API or by subclassing. The compile method sets the optimizer, loss function and metrics; fit trains for a number of epochs; evaluate runs the model in test mode and predict produces outputs. Custom code written with keras.ops is described as backend-agnostic across TensorFlow, JAX and PyTorch. Earlier Keras versions used different backend sets.

## How it shows up when you use agents

Keras appears when an agent writes or edits machine-learning code. If you ask Claude Code, Codex or Cursor for a small image classifier, the code it produces may import keras, define layers, call compile, then call fit. You will see Keras in imports, in a requirements file and in tracebacks, not in the agent's own settings. Keras is a library your project uses; it is not part of the agent.

What breaks when it is misunderstood: the backend. Keras 3 can run on JAX, TensorFlow or PyTorch, and the Keras guide says the backend cannot be changed once the package is imported, so it has to be configured first. An agent that mixes backend-specific calls into a model can produce code that runs on one framework and fails on another. Version also matters, because older tutorials describe earlier Keras releases with a different set of backends.

A practical next step: ask the agent to state which Keras version and backend it assumed, and to keep custom code on the keras.ops namespace if you want it portable. Then check the data split yourself; see [Overfitting](/glossary/overfitting). Compare the framework entries for [TensorFlow](/glossary/tensorflow) and [PyTorch](/glossary/pytorch). The catalogue has no skill that trains models, so the examples are contrast cases.

## Common confusions

- **Keras versus TensorFlow.** Keras is a library with its own API. According to Wikipedia it was first independent software, was later integrated into TensorFlow and later added support for more backends. Keras 3 runs on TensorFlow, JAX or PyTorch.
- **Keras versus a model.** Keras is the tool for building and training a model. A trained network is a separate artefact; see [Machine learning model](/glossary/machine-learning-model).
- **Keras 3 versus older Keras.** Wikipedia describes versions 2.4 through 3.0 as supporting just TensorFlow, then multi-backend again from 3.0. Check the version before copying a tutorial.
- **Myth: compile trains the model.** Per the Keras docs, compile configures the model for training, and fit does the training.

## Worked examples in this catalogue

### [data-analysis-eda](https://skillalmanac.com/skills/skill-almanac/data-analysis-eda)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: The skill is a fixed exploratory-analysis procedure and CSV profiler that keeps findings descriptive, evidenced and caveated.

Why it exercises the concept: A contrast case. Profiling a CSV is the kind of step that happens before data is fed to a Keras model, but the skill does not build or train one. The catalogue has no training skills, and this is illustrative, not executed.

### [split-leakage-check](https://skillalmanac.com/skills/skill-almanac/split-leakage-check)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: The skill checks train, validation and test files for duplicates, shared groups, time and label leakage and prints JSON.

Why it exercises the concept: Keras documentation shows a validation split being set aside during fit. This skill checks separately prepared split files and does not call Keras. This is illustrative, not executed.

### [Self-Hosting an AI Agent: What You Take On](https://skillalmanac.com/learn/self-hosted-ai-agent-considerations)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A guide on what you take on when an AI agent runs on your own machine: model memory, network exposure, file access and vetting skills.

Why it exercises the concept: It covers running models locally, which is a different job from writing a Keras network. It helps a reader separate a framework for building models from the work of hosting an agent. This is illustrative, not executed.

## Related terms

- [TensorFlow](https://skillalmanac.com/glossary/tensorflow.md)
- [PyTorch](https://skillalmanac.com/glossary/pytorch.md)
- [Deep learning](https://skillalmanac.com/glossary/deep-learning.md)
- [Neural network](https://skillalmanac.com/glossary/neural-network.md)
- [Machine learning model](https://skillalmanac.com/glossary/machine-learning-model.md)
- [Loss function](https://skillalmanac.com/glossary/loss-function.md)

## Sources

- [Keras 3 API documentation: Keras 3 is here](https://keras.io/keras_3/), Keras (accessed 2026-11-24)
- [Introduction to Keras for engineers](https://keras.io/getting_started/intro_to_keras_for_engineers/), Keras (accessed 2026-11-24)
- [Model training APIs](https://keras.io/api/models/model_training_apis/), Keras (accessed 2026-11-24)
- [Keras](https://en.wikipedia.org/wiki/Keras), Wikipedia (accessed 2026-11-24)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-24. [Glossary index](https://skillalmanac.com/glossary.md).
