# Clojure API for Running ONNX Models with ONNX Runtime

DevFeed: [Clojure API for Running ONNX Models with ONNX Runtime](<https://devfeed.tech/articles/clojure-runs-onnx-ai-models-now-join-the-ai-fun-20727.md>)

Original publisher: [Read original article](<http://dragan.rocks/articles/25/Clojure-Runs-ONNX-AI-Models-Now>)

Published: 2025-10-26T15:56:00Z

Content type: tutorial

Language: en

Sources: [Dragan Djuric](<https://devfeed.tech/sources/dragan-djuric.md>)

Topics: [Clojure](<https://devfeed.tech/topics/clojure.md>), [onnx](<https://devfeed.tech/topics/onnx.md>), [AI Models](<https://devfeed.tech/topics/ai-models.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [clojure](<https://devfeed.tech/tags/clojure.md>), [deep](<https://devfeed.tech/tags/deep.md>), [diamond](<https://devfeed.tech/tags/diamond.md>), [onnx](<https://devfeed.tech/tags/onnx.md>), [tensors](<https://devfeed.tech/tags/tensors.md>)

## AI overview

The author describes work on a Clojure API for using pre-trained models exported in ONNX format through ONNX Runtime. The approach uses ONNX Runtime's underlying C library rather than Python interoperability.

## Source excerpt

Hello, Clojurians! I haven't written here in a long time. Was I tired? Is anybody reading blogs anymore? Who knows. But that was not the main reason. I've been working on several Clojure projects sponsored by the Clojurists Together Foundation. I did a ton of things, but after all this programming, I was kinda tired, and kept slugging when it comes to telling people about the work done! That's not very smart, but you know how it goes... :) But, then, if we don't tell people about awesome software that we have, nobody is going to use it, so finally I had to stop kicking this down the road, sit, and write the first post. It's been long overdue, so expect more posts soon! ONNX Runtime in one line of Clojure The most recent thing I'm currently working on started its life as Clojure ML (again, superthanks to Clojurists Together for sponsoring this). I proposed to create a human-friendly Clojure API for AI/DL/ML models, and back it by the first implementation, in this case based on ONNX Runtime. Of course, it should all be integrated into existing Clojure libraries, and follow the Clojure way of doing stuff as much as possible! The idea is to get an existing, pre-trained ML model previously exported to the ONNX format from whatever technology the authors chose (which in today's world is typically Python and PyTorch), and put it into production in Clojure and JVM. It should be seamless and in-process, without any clunky interoperability, copy, translation, etc. Of course, our Clojure numerical libraries fully support GPU computing, so it goes without saying that we want that, too! Just to be clear, we do not use nor need any Python or Python interop for this, we use the ONNX Runtime's underlying C library. Nice idea, but what parts of this well intended story can we evaluate in our REPLs right now? At least some promising demo? Are we on the trail? To access that AI goodness, we surely have to do a sophisticated dance? Are the steps hard to learn? Do we need to watch careful