RUNLOCALAIv38
->Will it run?Best GPUCompareTroubleshootStartLearnPulseModelsHardwareToolsBench
Run check
RUNLOCALAI

Independently operated catalog for local-AI hardware and software. Hand-written verdicts. Source-cited claims. Reproducible commands when we have them.

OP·Fredoline Eruo
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
TOOLS
  • Will it run?
  • Compare hardware
  • Cost vs cloud
  • Choose my GPU
  • Prompting kits
  • Quick answers
REF
  • All buyer guides
  • Learn local AI
  • Methodology
  • Glossary
  • Errors KB
  • Trust
EDITOR
  • About
  • Author
  • How we make money
  • Editorial policy
  • Contact
LEGAL
  • Privacy
  • Terms
  • Sitemap
MAIL · MONTHLY DIGEST
Get monthly local AI changes
Monthly recap. No spam.
DISCLOSURE

Some links on this site are affiliate links (Amazon Associates and other first-class retailers). When you buy through them, we earn a small commission at no extra cost to you. Affiliate links do not influence our verdicts — there are cards we rate highly that we don't have affiliate relationships with, and cards that sell well that we refuse to recommend. Read more →

© 2026 runlocalai.coIndependently operated
RUNLOCALAI · v38
Glossary / Frameworks & tools / Keras
Frameworks & tools

Keras

Keras is a high-level neural network API, written in Python and capable of running on top of TensorFlow, JAX, or PyTorch. It provides a user-friendly interface for building, training, and deploying deep learning models, abstracting away much of the low-level complexity. Operators encounter Keras when using Hugging Face Transformers with TensorFlow backend, or when fine-tuning models with Keras's built-in training loops. It matters because Keras simplifies model prototyping and supports mixed precision training, which can reduce VRAM usage and speed up training on consumer GPUs.

Deeper dive

Keras was originally developed by François Chollet and released in 2015. It became the official high-level API for TensorFlow in 2017. In 2023, Keras 3.0 was released, supporting multiple backends (TensorFlow, JAX, PyTorch). This multi-backend support allows operators to choose the backend that best fits their hardware and workflow. For example, JAX offers XLA compilation for fast training on TPUs and GPUs, while PyTorch is widely used in research. Keras provides layers, optimizers, metrics, and callbacks (e.g., early stopping, model checkpointing). Operators often use Keras for fine-tuning pre-trained models from Hugging Face, where the model can be wrapped as a Keras model and trained with Keras's .fit() method. Keras also supports mixed precision training via tf.keras.mixed_precision or keras.optimizers.LossScaleOptimizer, which can reduce memory usage and increase throughput on GPUs with tensor cores.

Practical example

An operator fine-tuning a BERT model for text classification might use Hugging Face's TFAutoModelForSequenceClassification which returns a Keras model. They can then compile it with model.compile(optimizer='adam', loss='sparse_categorical_crossentropy') and train with model.fit(train_dataset, epochs=3). On an RTX 3060 12GB, enabling mixed precision via tf.keras.mixed_precision.set_global_policy('mixed_float16') can reduce VRAM usage from ~8GB to ~5GB and speed up training by ~30%.

Workflow example

In a typical fine-tuning workflow using Hugging Face Transformers with TensorFlow, an operator loads a model with TFAutoModel.from_pretrained('bert-base-uncased'), which returns a Keras model. They then compile and fit the model using Keras methods. When using model.fit(), Keras handles batching, gradient computation, and weight updates. Operators can add callbacks like tf.keras.callbacks.EarlyStopping to monitor validation loss and stop training if it plateaus, preventing overfitting. The trained model can be saved with model.save_pretrained() and later loaded for inference.

Reviewed by Fredoline Eruo. See our editorial policy.

Buyer guides
  • Best GPU for local AI →
  • Best laptop for local AI →
  • Best Mac for local AI →
When it doesn't work
  • CUDA out of memory →
  • Ollama running slowly →
  • ROCm not detected →