Description
The LLMInference class (in module.py) should delegate to or be implemented in terms of the functional API (in functional.py) rather than having a separate, parallel implementation.
Currently there may be duplication between:
LLMInference.forward() - the module-based approach
- Functions in
functional.py - the stateless, Value-aware approach
Having two separate implementations risks:
- Inconsistent behavior between module and functional styles
- Duplicated bug fixes and improvements
- Confusion about which approach is canonical
- Divergent handling of Value/ValueRef semantics
The LLMInference class should be a thin wrapper that internally uses the functional API, ensuring a single source of truth for LLM call behavior.
Acceptance Criteria
Notes
- The functional API in
functional.py operates on Value objects and propagates errors as values
LLMInference is defined in module.py as a subclass of InferenceModule
- This may require adding LLM-specific functions to
functional.py if they don't exist
Description
The
LLMInferenceclass (inmodule.py) should delegate to or be implemented in terms of the functional API (infunctional.py) rather than having a separate, parallel implementation.Currently there may be duplication between:
LLMInference.forward()- the module-based approachfunctional.py- the stateless, Value-aware approachHaving two separate implementations risks:
The
LLMInferenceclass should be a thin wrapper that internally uses the functional API, ensuring a single source of truth for LLM call behavior.Acceptance Criteria
LLMInferenceimplementation inmodule.pyLLMInference.forward()to delegate to functional APILLMInferenceusageNotes
functional.pyoperates onValueobjects and propagates errors as valuesLLMInferenceis defined inmodule.pyas a subclass ofInferenceModulefunctional.pyif they don't exist