# How to use LibTorch to run a LLM on Magic Leap

**URL:** <https://forum.magicleap.cloud/t/how-to-use-libtorch-to-run-a-llm-on-magic-leap/3820>\
**Category:** Native Development\
**Created:** [July 22, 2024, 4:18pm UTC](https://forum.magicleap.cloud/t/how-to-use-libtorch-to-run-a-llm-on-magic-leap/3820 "2024-07-22T16:18:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xinyu](https://avatars.discourse-cdn.com/v4/letter/x/67e7ee/32.png) [@Xinyu](https://forum.magicleap.cloud/u/Xinyu)\
**Post date:** [July 22, 2024, 4:18pm UTC](https://forum.magicleap.cloud/t/how-to-use-libtorch-to-run-a-llm-on-magic-leap/3820/1 "2024-07-22T16:18:28Z")

</div>

Give us as much detail as possible regarding the issue you're experiencing.

**ML2 OS version** :  
**MLSDK version** :  
**Host OS** : Windows

After cloning LibTorch on my Windows computer, I don't know how to link it to my project on Android Studio. My project came from a C-api sample of mlsdk 17.0. I need to use the functions of LibTorch to run a LLM on my magic leap.

---

<div class="post-metadata">

**Author:** ![kbabilinski](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kbabilinski/32/19_2.png) [@kbabilinski](https://forum.magicleap.cloud/u/kbabilinski)\
**Post date:** [July 22, 2024, 5:05pm UTC](https://forum.magicleap.cloud/t/how-to-use-libtorch-to-run-a-llm-on-magic-leap/3820/2 "2024-07-22T17:05:49Z")

</div>

Hi @Xinyu you may want to look at some of the tutorials from LibTorch to become more familiar on how to use the library and how to build a C++ android project

Pytorch Tutorials:

[https://pytorch.org/cppdocs/](https://pytorch.org/cppdocs/)  
[https://pytorch.org/tutorials/recipes/android\_native\_app\_with\_custom\_op.html](https://pytorch.org/tutorials/recipes/android_native_app_with_custom_op.html)

> **[Android](https://pytorch.org/mobile/android/)**
>
> Android

Android NDK Tutorials

> **[Get started with the NDK  |  Android NDK  |  Android...](https://developer.android.com/ndk/guides/)**

> **[Build your project  |  Android NDK  |  Android Developers](https://developer.android.com/ndk/guides/build)**

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/magicleap1/original/1X/bd9b737a4d45ea243aa7eb177d60a773b806899a.svg) [@system](https://forum.magicleap.cloud/u/system)\
**Post date:** [August 6, 2024, 5:06pm UTC](https://forum.magicleap.cloud/t/how-to-use-libtorch-to-run-a-llm-on-magic-leap/3820/3 "2024-08-06T17:06:09Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
