NVIDIA-NeMo / NVIDIA-NeMo/Guardrails
[Performance] Rule Engine Evaluation Slow - No Caching of Results
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.2k
- Forks
- 843
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 25
Description
Description
Safety rule evaluation takes 5+ seconds per request. No caching of identical rule evaluations.
Expected Behavior
Cache rule results. Use hash of input as cache key.
Actual Behavior
File: src/rules/engine.py
Re-evaluates rules each time: evaluate_rules(input)
GSSoC Points Estimate: Level 2 (Performance)
Suggested Labels
- gssoc:approved
- type:bug
- severity:high
- area:performance
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/rules/engine.py at evaluate_rules(input) and trace how rule evaluations are performed for repeated inputs. Add result caching using a hash of the input as the cache key. Done means identical rule evaluations reuse cached results while preserving the expected evaluation behavior and reducing repeated request latency.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, performance
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100