keras-team/keras
Multi-backend Python SDK for building, training, and running deep learning models
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
Keras 3 separates the Python model API from the execution runtime. Layers, models, metrics, and high-level training workflows sit above TensorFlow, JAX, or PyTorch. The runtime is selected before importing keras, using KERAS_BACKEND or ~/.keras/keras.json, and cannot be switched after import. OpenVINO occupies a narrower role: executing predictions rather than training.
PyPI packaging separates Keras from its runtime: the core dependency list includes NumPy, h5py, optree, and ml-dtypes, while the backend is installed separately. Extension is primarily through custom layers, models, metrics, and training steps. Teams can use Keras models in backend-native training loops, embed them in a PyTorch Module, or call them as part of a JAX model function. Portability depends on whether those extensions call backend-specific APIs.
Key Capabilities & Differentiators
Keras covers model development and training for vision, NLP, audio, time series, and recommender systems. Its v3.x compatibility floors are TensorFlow 2.16.1, JAX 0.4.20, and PyTorch 2.6.0 for training-capable backends, and OpenVINO 2026.2.0 for inference through model.predict(). These are minimum versions, not a guarantee that a particular model and accelerator combination will behave identically across runtimes.
Existing tf.data.Dataset pipelines and PyTorch DataLoaders can be used as inputs regardless of the selected backend. For tf.keras migration, the TensorFlow backend provides the closest starting point, with .keras as the current model.save() format. Models that rely on custom layers or train_step() need separate portability checks. Keras belongs at the model execution layer of an LLM inference stack, not in the role of a ready-to-deploy serving endpoint.
Trade-offs & Limitations
Compared with using PyTorch, JAX, or TensorFlow directly, Keras is most valuable when one model codebase has to support multiple runtimes. The cost is validating custom operations, numerical behavior, and performance on each target backend. If the project is committed to one runtime and already depends on native training code, using that framework directly avoids the need to maintain backend-neutral components.
Backend choice is fixed per initialized process, and training support is not symmetric: OpenVINO is prediction-only. Benchmark each candidate on the target hardware with representative models, batch sizes, and concurrency. Training memory also depends on gradients and optimizer state, so inference measurements are not a substitute for training measurements. The Apache-2.0 license allows commercial self-hosting, but backend packages, weights, and datasets still need their own license review.
Hardware & Deployment Guide
Install keras and the selected runtime in a clean Python environment. The current pyproject.toml requires Python 3.11 or newer; use that requirement rather than the Python 3.10 source-build example. The repository provides a CPU dependency setup and separate requirements-{backend}-cuda.txt files for JAX, TensorFlow, and PyTorch. The CUDA files install dependencies through pip but expect a preinstalled NVIDIA driver. Use separate environments to reduce CUDA version conflicts. Linux and macOS are supported, with WSL2 recommended for Windows.
Keras runs in your own Python process without a hosted API. The optional keras[gcs] extra adds gs:// artifact access without TensorFlow. Pin a patched release on the branch you deploy: v3.12.3 hardened HDF5 link handling, v3.12.4 addressed unsafe deserialization and decompression-bomb risks, and v3.15.1 also restricted unpickling for the IMDB and Reuters datasets. Verify the fix on the branch you run rather than treating those tags as a single upgrade sequence.
Teams that want to share model and training code across TensorFlow, JAX, and PyTorch, or evaluate OpenVINO as a separate prediction runtime.
You need a turnkey LLM serving endpoint, live backend switching within one process, or your project is already built around one runtime's native APIs.
Quick Start & Installation
pip install keras --upgrade
Comparison vs. Top LLMs & Inference Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| keras ★ | 64.5k | +24 | Python | Apache-2.0 | Multi-backend Python SDK for building, training, and running deep learning model |
| einops | 9.6k | +5 | Python | MIT | A backend-agnostic Python library for explicit tensor shape transformations |
| annotated_deep_learning_paper_implementations | 67.8k | +43 | Python | MIT | Annotated PyTorch references for understanding and adapting deep learning algori |
| pytorch-lightning | 31.5k | +31 | Python | Apache-2.0 | PyTorch training with a managed Trainer and Fabric for custom distributed loops |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/keras-team/keras.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about keras
How do I switch backends, and what happens to custom model code?
Do I need a GPU, and how should I size VRAM?
Can we self-host Keras for commercial use?
When is Keras a better choice than using a backend directly?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy