mlc-llm icon indicating copy to clipboard operation
mlc-llm copied to clipboard

[Question] Support for Flutter

Open microcoder-py opened this issue 2 years ago • 20 comments

❓ General Questions

Do you plan on providing support for flutter?

microcoder-py avatar Aug 16 '23 08:08 microcoder-py

Hi @microcoder-py , are you referring to Google's Flutter SDK? https://github.com/flutter/flutter

Kathryn-cat avatar Aug 18 '23 04:08 Kathryn-cat

Yes, that's the one. Now I know I could just write a platform native code for iOS/Android and bridge it to flutter, but doing it in dart would be much easier

microcoder-py avatar Aug 18 '23 14:08 microcoder-py

Thanks! We're looking into this and keep you posted.

Kathryn-cat avatar Aug 23 '23 09:08 Kathryn-cat

Hi @microcoder-py , thanks for the feedback. If there is a C FFI for flutter, then it might be possible for us to provide flutter support. However, we don't have execution plans atm.

We also welcome the community to contribute. Here's the interface to MLC's C++ API: https://github.com/mlc-ai/mlc-llm/blob/main/cpp/llm_chat.cc

Kathryn-cat avatar Aug 25 '23 07:08 Kathryn-cat

@Kathryn-cat there is a C FFI but we can write iOS and Android compatible code and bridge it to flutter. Since MLC already has Swift and Android support, maybe you could try only writing that bridge. I will try and do it myself but I am not a frontend dev

microcoder-py avatar Aug 25 '23 10:08 microcoder-py

Also thanks for the prompt responses

microcoder-py avatar Aug 25 '23 10:08 microcoder-py

Hi, just checking if there are any updates on this @microcoder-py ? We’d be interested in helping if that is possible.

nundys avatar Sep 12 '23 23:09 nundys

I'm also interested in Flutter support. I'm planning on giving it a spin myself but would be happy to collaborate if there's already an effort

Decron avatar Sep 24 '23 06:09 Decron

@nundys terribly sorry I missed your mention, as of now I have veered away from the on device use case, but if there is anything I can do from my end to help happy to contribute

microcoder-py avatar Sep 24 '23 07:09 microcoder-py

Hi @microcoder-py No problem, thanks for your response. @Decron, I haven't started yet but would be happy to join too.

nundys avatar Sep 24 '23 08:09 nundys

@junrushao I am working on flutter support for mlc-llm. The first step is to create the dart bindings to https://github.com/mlc-ai/mlc-llm/blob/main/cpp/llm_chat.cc Unfortunately the ffigen tool does not work well with the header: https://github.com/mlc-ai/mlc-llm/blob/main/cpp/llm_chat.h Could you help point to the relevant functions in the cc file which will need bindings? It looks like I will need to hand roll them. Any help appreciated.

anushreedhople avatar Oct 10 '23 11:10 anushreedhople

@anushreedhople I am very excited to try out your work! How's the progress?

breitburg avatar Nov 11 '23 01:11 breitburg

I would also love to try your progress! Locally running LLMs with flutter would be a dream come true!

MikiTheAlien avatar Nov 13 '23 14:11 MikiTheAlien

After reading a bit more, I think easiest way would to to interface the TVM C API and work through https://dart.dev/guides/libraries/c-interop.

The rust module might serve as a reference https://github.com/mlc-ai/mlc-llm/pull/1213. Although atm we do not have planned effort on this direction

tqchen avatar Nov 13 '23 16:11 tqchen

Any updates on this?

orkutmuratyilmaz avatar Apr 25 '24 07:04 orkutmuratyilmaz

Any update on this?

flutterocks avatar Sep 26 '24 23:09 flutterocks