harmonydata / app

Harmony front end
https://harmonydata.ac.uk/app/
MIT License
0 stars 4 forks source link

Add dropdown on FE to allow user to switch LLM #14

Open woodthom2 opened 7 months ago

woodthom2 commented 7 months ago

Description

Related to API fix: https://github.com/harmonydata/harmonyapi/issues/4

if you look at the API call https://api.harmonydata.ac.uk/docs#/Text/match_text_match_post there is already a parameter in the API to say which model we use

image

but we don't use it I would like the Harmony API repo to allow you to send "openai" and "gpt-4" or whatever so that it uses one of those once the API had this implemented we can add it to the front end as a dropdown like in this mockup image

so the dropdown should defualt to the huggingface model which harmony is already using but if they change it, then we use the third party LLMs I don't think we have enough users that it would be expensive but if that changes, we can start to ask users to paste their OpenAI API key

Rationale

the problem is, psychologists are using the tool but are sometimes unhappy with the matching. e.g. sometimes it thinks words are similar when they are not this is because the LLM I am running is an open source one from HuggingFace and Google and OpenAI's LLMs are better but they are 3rd party and need to be called via an API

ronnyTodgers commented 7 months ago

Are they better in this very specific task? It would be interesting to compare performance on the problematic matches that have been generated?

John Rogers Delosis Ltd

On 24 Mar 2024, at 11:40, Thomas Wood @.***> wrote:

Description

Related to API fix: harmonydata/harmonyapi#4 https://github.com/harmonydata/harmonyapi/issues/4 if you look at the API call https://api.harmonydata.ac.uk/docs#/Text/match_text_match_post there is already a parameter in the API to say which model we use

image.png (view on web) https://github.com/harmonydata/harmonyapi/assets/15210965/381690ba-a4f5-4e12-9d63-afcce8cd8937 but we don't use it I would like the Harmony API repo to allow you to send "openai" and "gpt-4" or whatever so that it uses one of those once the API had this implemented we can add it to the front end as a dropdown like in this mockup image.png (view on web) https://github.com/harmonydata/harmonyapi/assets/15210965/4a71707c-6727-40c0-8a71-89c3710542fe so the dropdown should defualt to the huggingface model which harmony is already using but if they change it, then we use the third party LLMs I don't think we have enough users that it would be expensive but if that changes, we can start to ask users to paste their OpenAI API key

Rationale

the problem is, psychologists are using the tool but are sometimes unhappy with the matching. e.g. sometimes it thinks words are similar when they are not this is because the LLM I am running is an open source one from HuggingFace and Google and OpenAI's LLMs are better but they are 3rd party and need to be called via an API

— Reply to this email directly, view it on GitHub https://github.com/harmonydata/app/issues/14, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFKMOW6YBLS2KOWBDOLWPD3YZ23R5AVCNFSM6AAAAABFFUCWZSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIYDIMZQHA3TCMY. You are receiving this because you are subscribed to this thread.

ronnyTodgers commented 6 months ago

We will need a "models available" field to be added to the status endpoint to achieve this - if it contains more than one model then the drop down is shown.