KerasHub now loads 300K+ Hugging Face models in one line of code
Curated by the Inblix editorial team
The wall between Hugging Face’s massive model collection and KerasHub just came down. Previously, KerasHub users could only work with models specifically saved in the Keras format — a tiny sliver of what the Hub offers. That changes now with a shared save format between Transformers and KerasHub, which unlocks direct access to over 300,000 models originally built with the Transformers library.
Initially, the integration covers Gemma (both versions 1 and 2), Llama 3, and PaliGemma architectures. Loading a fine-tuned checkpoint is as simple as pointing from_preset at a standard Hugging Face URL. The example in the announcement pulls NousResearch/Hermes-2-Pro-Llama-3-8B — a community fine-tune that was never touched by Keras — and generates text with it immediately. No conversion scripts, no manual weight mapping.
Under the hood, the process is less magical than it sounds. Transformers models ship as JSON config files plus safetensors weights, and since both libraries already have modeling code for these architectures, the integration just needs to map config variables, weight names, and tokenizer vocabularies between formats. That mapping happens automatically, which is why the user experience stays at one line of code.
What makes this genuinely interesting is the backend flexibility Keras brings to the table. KerasHub runs on TensorFlow, JAX, or PyTorch — you pick. So a checkpoint fine-tuned in PyTorch and sitting on the Hub can now be pulled into a JAX research environment or exported to TFLite for mobile deployment without any intermediate conversion steps. That’s a workflow that used to require real engineering effort, and it’s now a config change.
The announcement also confirms bfloat16 precision support via Keras’s dtype policy and walks through generation examples for Llama 3 and PaliGemma, including a community fine-tune called sd3-long-captioner for vision-language tasks. The Keras team says more architectures are coming, though they haven’t named which ones or given a timeline. Given how quickly the Gemma and Llama families have expanded, that roadmap will matter a lot for whether this integration becomes a default workflow or stays a convenient niche.
💡 Key Takeaways
- KerasHub users can now load any of the 300K+ Transformers models on Hugging Face without manual conversion, starting with Gemma, Llama 3, and PaliGemma architectures.
- The shared save format works by automatically mapping config variables, weight names, and tokenizer vocabularies between Transformers and KerasHub formats under the hood.
- Because KerasHub supports TensorFlow, JAX, and PyTorch backends, a single Hugging Face checkpoint can now be deployed to TFLite or moved into JAX research environments in one line of code.
- The initial architecture coverage is narrow but strategically chosen — Gemma, Llama 3, and PaliGemma are among the most actively fine-tuned model families on the Hub.
Keep reading: See related articles below for more coverage on this topic.
Get smarter about AI
The sharpest AI news, curated daily. Delivered free to your inbox.