-
Notifications
You must be signed in to change notification settings - Fork 2
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
Support for LLM backend: implementation plan #21
Comments
Hi, I think the architecture you suggest is a nice way to integrate a LLM running externally. I just have a few comments:
We look forward to seeing the results of your work! |
Thanks for your comments @pierrebeauguitte !
Yes, you are right. In any case the JSON response from the LLM needs to be parsed within LLMExtractor because it has to be transformed to the format Meteor expects. If anything goes wrong in that process, returning a 500 status code makes sense.
Yes, why not. There could be a parameter To make it easy to try this out, there could be an element in the web UI for selecting the backend.
Sure, no reason to break this. Thanks for the reminder! Also I think it's important to keep the unit tests working and ideally add new tests for all the new functionality. The current status is that we have an initial, very rough but working fine-tuned LLM based on Zephyr-7B, and it has been uploaded to HuggingFace Hub both in original HF format and in GGUF quantized format for CPU-only inference (e.g. for local development). We still need to take a closer look at inference platforms. After setting up one or more of those we can start development of the Meteor part. |
Hi again! There has been some progress on this lately: not yet the Meteor implementation part, but getting closer. Here are some news from FinGreyLit:
But the most relevant part when it comes to adding LLM support in Meteor is the new Jupyter notebook for metadata extraction using a LLM API service. It needs an API service such as llama.cpp running locally. That is really easy to install and run at least on Linux - see the instructions at the beginning of the notebook. So you may want to give it a try! It also shows how the text is extracted from the PDF and converted to the simple JSON format that the fine-tuned LLM expects. The same logic (text extraction, conversion to JSON, performing API calls to the LLM, parsing the results from the LLM) now just needs to be integrated into Meteor itself - as stated in the implementation plan above - and that's what I intend to try next! |
Hi,
our team at @NatLibFi has been looking at performing metadata extraction using large language models. Since our initial experiments have been promising, we would like to move towards a prototype system that could be used for demonstrations. Since Meteor already provides the basic building blocks (API, web UI, backend code that uses extraction heuristics...) we would like to extend the codebase with another backend that uses a LLM for the extraction part. We are going to develop this in a fork of this repo, https://github.com/NatLibFi/meteor and if you're interested, we could contribute the code back to this upstream repository sometime in the future (for now this would obviously be just a prototype).
This is the initial implementation plan:
Minimal LLM support for Meteor
Configuration:
Changes to Meteor class
Changes to MeteorDocument class
New LLMExtractor class
Do you think the above implementation plan sounds reasonable? It would result in an experimental version of Meteor that selects the extraction method (heuristics or LLM) at runtime based on the presence (or not) of an environment variable. This way the "traditional" Meteor approach can be compared head-to-head with the LLM version in terms of extraction quality, response time, resource usage etc. The LLM itself would be hosted as an external inference service (e.g. vLLM) used via API calls. In the initial version, we would stick to the metadata fields currently supported by Meteor, but in the future we would like to expand this to more fields, as the LLM approach allows adding more fields quite easily.
We are still working on prototyping the LLM based extraction techniques and fine-tuning local LLM models in the https://github.com/NatLibFi/FinGreyLit repository, in particular the
experiments
directory. It will take a while to set this up and start coding. I opened this issue to make you aware of our plans and potentially get feedback on what would make sense from your perspective.The text was updated successfully, but these errors were encountered: