Skip to content

llmr implementation#233

Open
Srikanth635 wants to merge 14 commits intocram2:mainfrom
Srikanth635:prods
Open

llmr implementation#233
Srikanth635 wants to merge 14 commits intocram2:mainfrom
Srikanth635:prods

Conversation

@Srikanth635
Copy link
Copy Markdown

@Srikanth635 Srikanth635 commented Mar 11, 2026

Added a brief README giving an overview of the llmr package functionality.

The pipeline takes a natural language instruction, decomposes it into atomic steps, and builds executable PyCRAM actions directly — covering pick-up and place actions for now.

Each step goes through slot filling (LLM classifies action + extracts parameters) → entity grounding (resolves object names to live world objects) → action dispatch, with automatic navigation and posture preconditions
prepended before each action. Failures are handled via LLM-driven replanning or graceful abort.

Requires an OPENAI_API_KEY. The LLM provider is configurable — Ollama is supported, which allows using open-source LLMs from a server.

@Srikanth635 Srikanth635 changed the title draft PR of llmr implementation llmr implementation Mar 24, 2026
@Srikanth635 Srikanth635 marked this pull request as ready for review March 24, 2026 09:15
from llmr.pipeline.action_dispatcher import ActionDispatcher, ActionHandler, WorldContext
from llmr.pipeline.entity_grounder import EntityGrounder, GroundingResult, ground_entity

__all__ = [
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is that?

def execute(self, schema: Any) -> Any:
"""Ground entities, build partial designator, resolve, return action."""

def _ground(self, description: EntityDescriptionSchema) -> GroundingResult:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

method doc



@dataclass
class PickUpActionHandler(ActionHandler):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you have to make a handler for every action type that adds alot of code to be maintained. why not have a generic pipeline from LLM to Action.



@dataclass
class PreconditionProvider(ABC):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These can be EQL-based, but that's also related to Jonas PR maybe have a look at it.



@dataclass
class ExecutionState:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have anything that preserves execution history in pycram? Probably, world states are relevant here as well. Such that this class is not needed or is a duplicate.

_graph_cache: Dict[Tuple[int, Type[BaseModel]], Any] = {}


def _build_resolver_graph(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is a resolver graph? resolver for what and why a graph?

# ── Private intermediate schema ────────────────────────────────────────────────


class _SlotFillerOutput(BaseModel):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean by a slot?

)


def _to_typed_schema(raw: _SlotFillerOutput) -> ActionSlotSchema:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not open closed, to add a new action for the LLM to handle one must modify this function

raw_dict: dict = final_state["slot_schema"]
action_type = raw_dict.get("action_type")

if action_type == "PickUpAction":
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same not open closed

user's instruction, you must decide the remaining discrete parameters needed to
execute a PickUpAction.

## PARAMETERS YOU DECIDE
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard coded parameter names and possible values are not maintainable as the code changes, make these depend on the actual class parameters and enum classes, because the one that changes the original definitions, will have to fix it here as well and you do not need to maintain it yourself.

@Srikanth635 Srikanth635 marked this pull request as draft April 7, 2026 14:12
@Srikanth635 Srikanth635 marked this pull request as ready for review April 14, 2026 10:32
@Srikanth635
Copy link
Copy Markdown
Author

removed explicit sdt world dependencies to isolate this package operations independent.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants