-
Notifications
You must be signed in to change notification settings - Fork 226
verdi llm cli
, AiiDA users benefit from LLM; a proof of concept.
#6834
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
base: main
Are you sure you want to change the base?
Conversation
smart cli
, a proof of concept for LLM use-case in AiiDA
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6834 +/- ##
==========================================
- Coverage 78.29% 78.17% -0.12%
==========================================
Files 566 569 +3
Lines 42764 42871 +107
==========================================
+ Hits 33479 33508 +29
- Misses 9285 9363 +78 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
smart cli
, a proof of concept for LLM use-case in AiiDAverdi smart cli
, AiiDA users benefit from LLM; a proof of concept.
Proposed names:
|
@giovannipizzi |
verdi chatbot? Makes more the sense it's a bot replying |
Also |
verdi smart cli
, AiiDA users benefit from LLM; a proof of concept.verdi llm cli
, AiiDA users benefit from LLM; a proof of concept.
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.
I think it is better to create the verdi_cli.json
when the command is first time invoked instead so we don't blow up the src code (for review it is great to see it). Then you could cache the embedding (maybe repository)?
Why don't you include the description of the options of the commands in the verdi_cli.json
? For example, for verdi process kill --help
:
-a, --all Kill all processes if no specific processes
are specified.
Seems like useful information.
Maybe we instead of letting the user to create the embedding, we upload them for each aiida version so the user never needs any llm package, the user just needs to download it from an external resource. That would make the user's life easier. It behaves then more like RTD.
with open(self.json_path, 'r') as f: | ||
self.data = json.load(f) | ||
|
||
self.model = SentenceTransformer('all-MiniLM-L6-v2', device='cpu') |
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.
should try to detect gpu, if not then go to cpu
'chardet~=5.2.0;platform_system=="Windows"' | ||
'chardet~=5.2.0;platform_system=="Windows"', | ||
'faiss-cpu~=1.11', | ||
'sentence_transformers~=4.1' |
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.
This needs to be an optional dependencies! Or maybe we can completely remove it (see third point of my comment)
For now, it only works with Groq, because it provides free API.
More backends will be added later.
First, configure for once:
verdi llm configure --backend groq --api-key <API-KEY>
-- to generate a key see hereNow you can ask whatever you want, the limit is your imagination 🤞
$ verdi llm cli 'list all processes'
It will then, respond with a generated command and asks for a confirmation (
e
) before executing it.Alternatively the user has the option (
m
) to edit the command before executing, to fix mistakes:Groq is not trained on AiiDA so the outcome is not gonna be magnificent. This PR provide an interface, for future implementation of a trained model. See project: PLACEHOLER
An ideal model after training will be able to answer to such commands:
OR
The latest one is a nice example. Although the only supported flag for timely listing is
--past-days
; such a smart interface can first, find out there's no official command to support that, and second, would be able to suggest a workaround.Although the interface is not finalized, early reviews and discussions are welcome.
UPDATE:
RAG added. Now it's able to answer to use more flags to response precisely: