ImportError: cannot import name 'GradientBaseModelLLM' from 'llama_index.llms'
08:48 13 Sep 2026

I am trying to run a script which uses GradientBaseLLM. Apparently the script was written by someone else couple of years back and I having tough time upgrading. I am importing

from llama_index.llms import GradientBaseLLM

I am getting the following error:

ImportError: cannot import name 'GradientBaseModelLLM' from 'llama_index.llms'

What is wrong with the llama_index. It looks like a lot has been updated. Any idea where can I find the cure for this? Any help would be appreciated.

python-3.x llama llama-index