Skip to content

There is no result cache on the server side #9

Closed
ChEB-AI/python-chebifier
#15

Description

@MGlauer

At its current state Chebifier does not store results of previous predictions.

Visualisations should not be cached. Instead, a specific "recalculate" flag should be available to retrieve them.

Before each prediction, the system should do the following:

  1. Check all chemicals for pre-existing predictions based on the InCHI code that to not have an explicit "recalculate" flag
  2. Predict only those that are not in the cache yet
  3. Predict missing ones
  4. Add predictions to cache database

This cache should be flushed at the end of the. Or at least matched against the new model.

Activity

  1. sfluegel05 commented on Jul 21, 2025

    @sfluegel05
    Contributor

    @aditya0by0 This might be a good issue for you.

    Since we are now including more models, this becomes more relevant. Most of the implementation will probably take place in python-chebifier. The main challenge is caching elements of a list while the function (predict_smiles_list) is called with the whole list.

    So far, I have tried wrapping it with the standard cache annotation: https://github.com/ChEB-AI/python-chebifier/blob/47126b884886676f7baeac4f7f2efb9b562d3bf6/chebifier/prediction_models/nn_predictor.py#L55
    However, I am not sure if that works at all. If it works, it is still not perfect. For example, if the user removes one element from the list, the rest should still be retrieved from cache. Or if they click the lightbulb, we need the predictions for one of the listed samples, which currently leads to a complete recalculation of the predictions for this sample.

    The solution I image would include:

    • per-SMILES and per-model caching: for each SMILES, we run each model exactly once. Even if the user changes the models or adds new SMILES, we should reuse what has been calculated once.
    • batch processing for neural networks: this is the main reason why we are processing lists instead of single SMILES in the first place: Neural networks work more efficiently when we can predict a whole batch at once. The tricky part will be to cache each SMILES individually, but predict them together.
  2. aditya0by0 commented on Jul 30, 2025

    @aditya0by0
    Member

    @sfluegel05, Please provide me the write access to this repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions