Skip to content
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

[Factors] Integrate llm factor #2742

Merged
merged 1 commit into from
Aug 22, 2024
Merged

[Factors] Integrate llm factor #2742

merged 1 commit into from
Aug 22, 2024

Conversation

rylev
Copy link
Collaborator

@rylev rylev commented Aug 22, 2024

Integrates the LLM factor into trigger2.

I don't really love how the use_gpu configuration item (which for now is hardcoded as true) is being weaved through out the code, but I'd rather go back in a follow up PR to try to clean up how we handle configuration in some holistic way.

@rylev rylev requested a review from lann August 22, 2024 12:30
spin-factors = { path = "../factors" }
spin-llm-local = { path = "../llm-local" }
Copy link
Collaborator

Choose a reason for hiding this comment

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

There are feature flags in the root spin-cli and old spin-trigger and spin-trigger-http crates that control dependencies for this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm going to do some small refactorings in a follow up that will make this easier to bring back.

Comment on lines 20 to +21
pub struct LlmFactor {
create_engine: Box<dyn Fn() -> Box<dyn LlmEngine> + Send + Sync>,
default_engine_creator: Box<dyn LlmEngineCreator>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Out of scope for this PR but I'd like to standardize on the approach used with e.g. OutboundMysqlFactor<C = MysqlClient> for this sort of thing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yea, I'd personally like to move away from generics and towards using dynamic dispatch like we do here.

@rylev rylev merged commit be24451 into factors Aug 22, 2024
2 checks passed
@rylev rylev deleted the integrate-llm-factor branch August 22, 2024 15:01
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.

2 participants