make model cache global

This makes all threads share the cache.