War was not inevitable but its likelihood was determined by events and personalities.
If all things remained the same I think it could be averted even as late as July 1914. Somebody in Germany had to insist that the Austrians be told bluntly that Berlin agreed with London that the Serbian response to the Austrian demands were acceptable. Tear up the blank cheque and tell the Emperor that he had no choice but to go to the negotiating table but with the support of Germany, the UK and probably even France, for levering even greater concessions from Serbia. Even Willie thought that Franz Joseph should accept the terms offered so if there had been an influential person at court who could have given him some support and confidence, war could have been averted.
It should have been obvious to everyone that if Austria conditionally accepted the initial Serbian response and had the support of nearly all the European Great Powers for a further round of concessions, then Russia would not push its support for Serbia so far as it had threatened. Further, if Russia could be persuaded that Serbian elements that exposed extremism threatened Pan-Slavism rather than promoted it even Russia could have leant on Serbia to concede more.
Such a stand in Berlin would have emboldened Hungry even more and may possibly have led to them absolutely refusing to support Austrian moves towards war instead of opposing it politically but eventually caving in. Without the support of the other half of the Dual Monarchy, it is difficult to see the Empire being able to wage war when faced with such a large constitutional crisis.
which would result in crisis of 1914 to be seen as difused as crisis of 1905 was. But what about rest of tensions? Anglo-German and Franco-German?