---
title: "Announcing New Hugging Face and KerasHub integration"
description: "KerasHub can now load Transformers-format checkpoints from the Hugging Face Hub directly, through a shared model save format."
url: "https://swe.quest/articles/announcing-new-hugging-face-and-kerashub-integration-4c5abe3fdc47bd7b"
canonical: "https://huggingface.co/blog/keras-hub-integration"
source: "Hugging Face"
published: "2024-07-10"
difficulty: "medium"
kind: "Announcement"
reading_minutes: 5
tags: ["machine-learning","llms","python"]
---

# Announcing New Hugging Face and KerasHub integration

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2024-07-10, 5 min read, Announcement. Original: [https://huggingface.co/blog/keras-hub-integration](https://huggingface.co/blog/keras-hub-integration)

## Summary

KerasHub can now load Transformers-format checkpoints from the Hugging Face Hub directly, through a shared model save format. Initial support covers Gemma 1 and 2, Llama 3 and PaliGemma, and the models can run on TensorFlow, JAX or PyTorch backends. Loading works by mapping the Transformers JSON config, tokenizer and safetensors weight names onto KerasHub's equivalent architecture code, which also allows conversion in the other direction. Code examples show \`from\_preset("hf://...")\` loading, text generation, setting bfloat16 precision and switching to the JAX backend.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Machine learning](https://swe.quest/tags/machine-learning.md) (AI & ML)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Python](https://swe.quest/tags/python.md) (Languages)

## Prerequisites

- Keras basics
- Hugging Face Hub

## Keywords

KerasHub, Hugging Face Transformers, Keras 3, Gemma, Llama 3, PaliGemma, safetensors, JAX

## Related posts

- [“Llama 3.2 in Keras”](https://swe.quest/articles/llama-3-2-in-keras-c28d5e4494723a08.md): Hugging Face · 2024-10-21 · Medium · 5 min read · Model training, LLMs, Python, Inference & serving
  Keras (via keras\_hub) loads Llama 3.2 directly from standard safetensors Hugging Face checkpoints with on-the-fly conversion, so it has worked since day one.
- [Transformers now runs llama.cpp quants](https://swe.quest/articles/transformers-now-runs-llama-cpp-quants-cff2353854049dc6.md): Hugging Face · 2026-09-22 · Medium · 11 min read · Inference & serving, LLMs, Python, Performance engineering
  Hugging Face transformers can now load GGUF (llama.cpp) quantized checkpoints via \`from\_pretrained(..., gguf\_file=...)\` and serve them through \`transformers serve\` with an OpenAI-compatible API.
- [Tricks from OpenAI gpt-oss YOU 🫵 can use with transformers](https://swe.quest/articles/tricks-from-openai-gpt-oss-you-can-use-with-transformers-aad70bf42c0bd3ff.md): Hugging Face · 2025-09-11 · Hard · 15 min read · Inference & serving, LLMs, Python, Performance engineering
  Hugging Face upgraded transformers to support OpenAI's gpt-oss models, and most of the new features carry over to other models.
- [Hugging Face's TensorFlow Philosophy](https://swe.quest/articles/hugging-face-s-tensorflow-philosophy-1d3751167c605c69.md): Hugging Face · 2022-08-12 · Medium · 14 min read · Machine learning, Python, Model training, Compilers
  Hugging Face's transformers library treats TensorFlow models as first-class Keras citizens: every model is a Keras Model and every layer a Keras Layer, so fit(), compile() and predict() work directly, and models compose into custom hybrids via subclassing.
- [Fine-Tuning Gemma Models in Hugging Face](https://swe.quest/articles/fine-tuning-gemma-models-in-hugging-face-d432d00965e71590.md): Hugging Face · 2024-02-23 · Medium · 5 min read · Model training, LLMs, Python
  Gemma 2B and 7B can be fine-tuned cheaply with LoRA via the Hugging Face PEFT library, loading the base model in 4-bit NF4 with bitsandbytes (QLoRA) so it fits on free Colab GPUs.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
