If I upgrade transformers to the latest version, then optimum-cli doesn't work, as it requires transformers <5.1
@hachuah what is the exact issue you're facing ? you should be able to export gemma4 models by upgrading your transformers to v5.5 after installing optimum-intel (even though optimum-intel doesn't officially support v5.5).
Also here you're trying to export a gemma 4 unfied model, support for this architecture was introduced in https://github.com/huggingface/optimum-intel/pull/1770 and is not included in optimum-intel v2.0 (unlike gemma 4), so you'll have to install optimum-intel from source as well as transformers v5.10 (next optimum-intel release is planned for 29/07)