v1.4.1

roboflow/inferencev1.4.1Aug 14, 2026by PawelPeczek-Roboflow

AI Summary

This release fixes a critical Google Colab import crash caused by PyTorch and TorchAudio CUDA version mismatches and adds new AI model integrations like Grok and Gemini 3.7 Flash.

Key Highlights

  • Fix for Google Colab import crash due to CUDA version mismatch
  • Integration of xAI's Grok vision models (v4.6/v4.5) into Workflows
  • Support for Google Gemini 3.7 Flash in Google Gemini blocks
  • Enhanced usage and cache telemetry with model architecture attribution
  • Removal of dual GPU build tag (standard image now runs Cosmos 3 Edge)

New Features

  • SpaceXAI Grok workflow block
  • Gemini 3.7 Flash support
  • Deeper usage and cache telemetry
  • MQTT Writer sink block namespace
  • Regression coverage for pipeline stream controls

Full Release Notes

> [!WARNING]
> ## ⚠️ Installing `inference` in Google Colab? Read this first
> Starting with this release, `pip install inference` in a fresh Google Colab runtime can crash on `import inference` with `RuntimeError: Detected that PyTorch and TorchAudio were compiled with different CUDA versions`. Colab preinstalls a `torchaudio` built for an older CUDA than the torch that dependency resolution installs, and new `transformers` imports `torchaudio` when present in env.
**Fix: remove the stale torchaudio before importing** — it takes one cell:
> ```
> !pip uninstall -y torchaudio
> ```
> Run it right before `pip install inference` and before the first import — then no restart is needed. If you already hit the error, uninstall and restart the runtime (Runtime → Restart session) so the failed import is not cached. If you actually use `torchaudio` in the same notebook, reinstall a build matching your torch version instead of removing it.


# 🚀 Added

## 🤖 SpaceXAI Grok workflow block (Grok 4.6 / 4.5)

The new `roboflow_core/spacexai@v1` block brings xAI's Grok vision models into Workflows, with **Grok 4.6** as the default and Grok 4.5 selectable. It speaks xAI's OpenAI-compatible Responses API and supports the full VLM task lineup — unconstrained prompting, VQA, OCR, captioning, classification and structured answering — plus **object detection using the percent-of-image `box_2d` contract** that won the vlm-exam benchmark for Grok, with `vlm_as_detector@v2` shipping the matching `model_type="spacexai"` parser. (@SkalskiP, https://github.com/roboflow/inference/pull/2799).

## ⚡ Gemini 3.7 Flash in the Google Gemini blocks

Google released Gemini 3.7 Flash on Aug 13 and it is selectable in `google_gemini@v3` and `google_gemini@v4` the day after, with thinking-level control and native code execution enabled — validated by full-benchmark runs across all six VLM tasks before flipping the switch (@SkalskiP, https://github.com/roboflow/inference/pull/2794).

## 📊 Deeper usage and cache telemetry

Usage rows can now be attributed by **model architecture** (`resource_details.model_type`, e.g. `rfdetr-seg-nano`) and by the **input resolution the model actually ran at**, bucketed in megapixels — resolved from a process-local cache at model load so the hot path never does a registry lookup (@SolomonLake, https://github.com/roboflow/inference/pull/2782). SAM3's visual-segment encoder fast path also gains a bounded Prometheus counter reporting embedding-cache `hit` / `miss` / `not_attempted` outcomes (@hansent, https://github.com/roboflow/inference/pull/2779).

# 🔧 Fixed

- **Vision Events sink no longer drops assume-identity headers** — the sink built its own request headers instead of going through `build_roboflow_api_headers()`, so deployments authenticating via `ROBOFLOW_API_EXTRA_HEADERS` had their event writes silently rejected upstream while the block reported success (@rvirani1, https://github.com/roboflow/inference/pull/2774).
- **`MemoryCache.acquire_lock` actually serialises on one key now** — a check-then-act race let two callers racing on a missing key each build their own lock and both enter the protected section, and the lock refresh reused `Lock.acquire`'s `-1` "block forever" sentinel as a cache expiry, storing the entry one second in the past and poisoning its own cache slot (@adhavan18, https://github.com/roboflow/inference/pull/2795).
- **WebRTC callback shutdown deadlock removed** — `WebRTCSession.close()` called from `on_data`/`on_error` callbacks blocked the session event loop waiting on cleanup scheduled onto that same loop; loop-initiated cleanup is now dispatched to a helper thread without blocking (@voropaevv, https://github.com/roboflow/inference/pull/2778).
- **TrOCR works under transformers 5.15** — the new transformers force-routes `vision-encoder-decoder` checkpoints to its generic tokenizer backend, which cannot read the sentencepiece-only serialization Roboflow model packages ship; the TrOCR loader now builds its processor from the tokenizer class declared in the package instead (@PawelPeczek-Roboflow, https://github.com/roboflow/inference/pull/2798).
- **`pip install inference` in Google Colab no longer crashes on import** — Colab preinstalls a torchaudio whose CUDA build no longer matches the torch that dependency resolution installs, and transformers 5.x imports torchaudio whenever it is present; the Colab verification images drop the stale torchaudio, and Colab users hitting the crash can do the same with `pip uninstall -y torchaudio` (@PawelPeczek-Roboflow, https://github.com/roboflow/inference/pull/2798).
- **GPU image dependency resolution fixed for torch 2.6+cu124 builds** (@PawelPeczek-Roboflow, https://github.com/roboflow/inference/pull/2796).

# 🚧 Maintenance

## 🧵 transformers unpinned — one GPU build again

The dependency structure now allows **transformers up to the 5.15 line** across the repo and `inference-models` (@PawelPeczek-Roboflow, https://github.com/roboflow/inference/pull/2797, https://github.com/roboflow/inference/pull/2798). Since transformers 5.15.0 ships the NVIDIA Cosmos 3 Edge model code, the GPU image installs it straight from PyPI and the git-pin override step is gone — which retires the dual GPU build from v1.3.8/v1.3.9: **there is no separate `-cosmos3` tag anymore**, the standard `roboflow/roboflow-inference-server-gpu:1.4.1` image runs Cosmos 3 Edge out of the box.

- **MQTT Writer sink gets a block namespace** — `roboflow_enterprise/mqtt_writer_sink@v1` is the primary identifier (it was the only block among 201 without a namespace), and the bare `mqtt_writer_sink@v1` stays on as a legacy alias so existing workflows keep working (@shntu, https://github.com/roboflow/inference/pull/2783).
- **Regression coverage for pipeline stream controls** — `pause_stream()`, `mute_stream()` and `resume_stream()` are now exercised across all-sources, matching-source and unknown-source cases (@arubittu, https://github.com/roboflow/inference/pull/2790).
- **PR-review skill suite updated** after the tensor-native Workflows merge (@PawelPeczek-Roboflow, https://github.com/roboflow/inference/pull/2791).

## 🏅 New Contributors
* @arubittu made their first contribution in https://github.com/roboflow/inference/pull/2790
* @adhavan18 made their first contribution in https://github.com/roboflow/inference/pull/2795

**Full Changelog**: https://github.com/roboflow/inference/compare/v1.4.0...v1.4.1