Skip to content

Conversation

@Pouyanpi
Copy link
Collaborator

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.
@Pouyanpi Pouyanpi added this to the v0.16.0 milestone Aug 19, 2025
@Pouyanpi Pouyanpi added the enhancement New feature or request label Aug 19, 2025
@Pouyanpi Pouyanpi requested review from Copilot and tgasser-nv August 19, 2025 09:32
@Pouyanpi Pouyanpi self-assigned this Aug 19, 2025
Copy link

Copilot AI left a 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.

Base automatically changed from refactor/rails-llm to develop August 19, 2025 16:12
@Pouyanpi Pouyanpi requested a review from cparisien August 19, 2025 16:13
@Pouyanpi Pouyanpi merged commit a5e8b4c into develop Aug 21, 2025
23 checks passed
@Pouyanpi Pouyanpi deleted the feat/isolate-llms-config-actions branch August 21, 2025 08:03
Pouyanpi added a commit that referenced this pull request Oct 1, 2025
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants