Contents

Transparent GPT-5 Support in My Clojure ChatGPT Library

🐾 Pyjama, the Ollama/ChatGPT Clojure Wrapper Now Speaks Fluent GPT-5 (and Still Recognizes Cats)

It’s always a good day when your code gets smarter — and an even better day when it can still identify a cute kitten.

With OpenAI rolling out the GPT-5 family (gpt-5, gpt-5-mini, gpt-5-nano), I wanted my Clojure ChatGPT wrapper to transparently support the new models without breaking a sweat.


Calling GPT-5 Is This Simple

Whether you’re sending text or adding vision, the call looks almost the same:

;; Text-only request
(gpt/chatgpt {:model "gpt-5"
              :prompt "Write a haiku about summer rain."})

;; Vision request
(gpt/chatgpt {:model "gpt-5"
              :prompt "What is shown in this image?"
              :image-path "resources/cute_cat.jpg"})

That’s it. Same function, same keys — add :image-path if you want GPT-5 to see what you see. Optional keys like :streaming or :temperature fit right in without breaking model support.


The Tests: One Cat, Many Brains

We keep the same adorable resources/cute_cat.jpg, and simply loop through each model to make sure the output is stringy, non-empty, and contains either cat or kitten.

(def models ["gpt-5" "gpt-5-mini" "gpt-5-nano"])
(def cat-img "resources/cute_cat.jpg")

(defn ^:private cat? [s]
  (boolean (re-find #"(?i)\b(cat|kitten)\b" (str s))))

(deftest gpt5-vision-tests
  (doseq [m models]
    (testing (str "Vision with " m)
      (let [out (ask-vision m)]
        (println "\n[" m "] OUTPUT:\n" out)
        (is (seq (str out)))
        (is (cat? out))))))

The Cat Results — Side-by-Side

Below is the actual output each GPT-5 variant gave when looking at the same picture of a small, fluffy feline.

Model Description Output
gpt-5 “A fluffy tabby cat sitting on a wooden floor, looking up with curious eyes.”
gpt-5-mini “A cute kitten with soft fur and big eyes staring directly at the camera.”
gpt-5-nano “A small cat, likely a kitten, sitting indoors and gazing upwards.”

(Your exact outputs may vary — models sometimes change phrasing on different runs.)


Why This Matters

By abstracting the model name into the test list, I can:

  • Swap in new models with zero boilerplate.
  • Keep vision tests consistent across the fleet.
  • Verify that newer models behave at least as well as the older ones in common tasks.

What’s Next?

  • Multi-image input tests: Will GPT-5 mini get overwhelmed by two kittens?
  • Benchmarking latency vs accuracy across the mini and nano variants.
  • Contextual chaining: feeding GPT-5’s own cat descriptions back in for creative remixes (“Describe this cat as if it’s a noir detective”).

Transparent model support isn’t just maintenance — it’s an invitation to experiment. The models evolve fast; our libraries should be just as nimble.