Implement a thread-safe cache mechanism for an LLM inference endpoint.
Implement llm_cached_inference(requests, capacity, ttl). Each request contains prompt, model, parameters, time, and the response that a cache miss would produce. Return a dictionary containing responses in request order and the number of simulated inference calls. Requests with identical prompt, model, and parameters share a cache entry. Entries expire after ttl time units, and capacity eviction must follow LRU order. Protect all cache state with synchronization so concurrent access cannot corrupt it.
requests is a list of dictionaries. Return {"responses": [...], "inference_count": integer}.
def llm_cached_inference(requests, capacity, ttl):