Beginning with Gurobi 9.0, log files contain a model fingerprint:
Model fingerprint: 0x6775726fTwo models have the same fingerprint if and only if they are exactly the same. If two optimizations are solved, using two models with identical fingerprints, on the same platform, using the same Gurobi parameter settings then the solution path will be the same for both optimizations. This means that Gurobi will explore the same number of nodes, use the same number of simplex iterations, etc. Note that for two models to be considered identical, the constraints and variables must be in the same order. Additionally, attributes such as VarHintVal, BranchPriority, Partition, PoolIgnore, VBasis, CBasis, PStart, DStart, will affect the model fingerprint.
The fingerprint can be used to confirm that you are solving the same model. If two models have different fingerprints, then the models are different in some way. This can occur if the code that creates the model is non-deterministic. Common sources of non-determinism in Python code are (i) Python's built-in sets and (ii) certain pandas operations.
You can also query the model fingerprint using the Fingerprint attribute. Note that the fingerprint is shown in the Header of the log file in hexadecimal format, but it is in decimal format when queried from the Fingerprint attribute. Note that a decimal value can be converted to hexadecimal in Python with the following code (where model is the name of the gurobipy model):
hex((model.Fingerprint + (1 << 32)) % (1 << 32))