-
Notifications
You must be signed in to change notification settings - Fork 583
feat(llmrails): isolate LLMs only for configured actions #1342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Update isolated LLM creation to only target actions defined in rails config flows. This ensures that LLMs are not unnecessarily created for actions not present in the configuration. Adds comprehensive tests to verify correct behavior, including handling of empty configs and skipping already-registered LLMs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Updates the isolated LLM creation logic to only create LLMs for actions that are explicitly configured in the rails configuration flows. This optimization prevents unnecessary LLM creation for actions not present in the configuration and adds comprehensive test coverage for various configuration scenarios.
Key changes:
- Modified
_create_isolated_llms_for_actions()to only process actions from configured rails flows - Added logic to extract action names from input and output flows using
get_action_details_from_flow_id - Added comprehensive test coverage for edge cases including empty configs and non-LLM-requiring actions
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| nemoguardrails/rails/llm/llmrails.py | Updated _create_isolated_llms_for_actions() to filter actions based on rails configuration flows |
| tests/test_llm_isolation.py | Enhanced unit tests with flow configuration mocking and edge case coverage |
| tests/test_llm_isolation_e2e.py | Added end-to-end test class for comprehensive scenario validation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]> Signed-off-by: Pouyan <[email protected]>
Update isolated LLM creation to only target actions defined in rails config flows. This ensures that LLMs are not unnecessarily created for actions not present in the configuration. Adds comprehensive tests to verify correct behavior, including handling of empty configs and skipping already-registered LLMs.
Update isolated LLM creation to only target actions defined in rails config flows. This ensures that LLMs are not unnecessarily created for actions not present in the configuration. Adds comprehensive tests to verify correct behavior, including handling of empty configs and skipping already-registered LLMs.