Ersilia Book
  • 🤗Welcome to Ersilia!
    • The Ersilia Open Source Initiative
    • Ten principles
    • Ersilia's ecosystem
  • 🚀Ersilia Model Hub
    • Getting started
    • Online inference
    • Local inference
    • Model contribution
      • Model template
      • Model incorporation workflow
      • Troubleshooting models
      • BioModels annotation
    • For developers
      • Command line interface
      • CI/CD workflows
      • Test command
      • Testing playground
      • Model packaging
      • Inputs
      • Codebase quality and consistency
      • Results caching
  • 💊Chemistry tools
    • Automated activity prediction models
      • Light-weight AutoML with LazyQSAR
      • Accurate AutoML with ZairaChem
      • Model distillation with Olinda
    • Sampling the chemical space
    • Encryption of AI/ML models
  • AMR chemical collections
  • 🙌Contributors
    • Communication channels
    • Tech stack
    • Internships
      • Outreachy Summer 2025
      • Outreachy Winter 2024
      • Outreachy Summer 2024
      • Outreachy Winter 2023
      • Outreachy Summer 2023
      • Outreachy Winter 2022
      • Outreachy Summer 2022
  • 📑Training materials
    • AI2050 intro workshop
    • AI2050 AI for Drug Discovery
    • Introduction to ML for Drug Discovery
    • Python 101
    • External resources
  • 🎨Styles
    • Brand guidelines
    • Slide and document templates
    • Scientific figures with Stylia
    • Coding style
  • 🌍About Us
    • Where to find us?
    • Diversity and inclusion statement
    • Code of conduct
    • Open standards and best practices
    • Ersilia privacy notice
    • Strategic Plan 2025-2027
    • Ersilia, the Invisible City
Powered by GitBook

2025, Ersilia Open Source Initiative

On this page
  • Local caching
  • Caching Features
  • Set up and installation
  • How to Control Caching

Was this helpful?

  1. Ersilia Model Hub
  2. For developers

Results caching

PreviousCodebase quality and consistencyNextAutomated activity prediction models

Last updated 21 days ago

Was this helpful?

The Ersilia Model Hub enables caching of the model inference results to save computational time. By default, all users can enable local caching through REDIS, and Ersilia maintainers can also cache results in the cloud.

Local caching

Ersilia provides built-in caching using to improve performance by storing model results. This caching system does not target variable outputs from generative models but instead caches various types of model outputs. The cache key is generated by creating an MD5 hash from the combination of the model ID and its input (e.g., SMILES string). It only supports models which are packed using the FastAPI-based ersilia-pack server (more on this in ).

Caching Features

  • Automatic Caching: By default, Ersilia caches model results.

  • Key Generation: A unique key is created using an MD5 hash based on the model ID and input.

  • Flexibility: Caching can be turned off during server startup if desired.

Set up and installation

Redis will be installed and set up automatically if Docker is installed and running in your system. Else, caching will be skipped as if the --no-cache flag was used.

How to Control Caching

When starting the Ersilia server, you can decide whether to use caching with these command-line options:

ersilia server eos3b5e --cache #default
ersilia server eos3b5e --no-cache #disables caching

Memory Management

Redis manages its memory usage based on available system resources. By default, it uses 30% of the system RAM for caching. You can adjust this limit by specifying a different memory usage fraction. Simply replace with the desired fraction of your system's RAM that Redis should use. Recommended range is 0.1-0.7.

ersilia serve eos3b5e --max-cache-memory-frac <fraction>
🚀
Redis
Model packaging