Code Monkey home page Code Monkey logo

on-device-llm-inference-using-mediapipe's Introduction

On-device-LLM-Inference-using-Mediapipe

On-device LLM Inference using Mediapipe LLM Inference API.

LLM Task Sample Setup Guide

This guide provides step-by-step instructions on how to set up and run a sample LLM task on your local machine. Ensure you have Python (3.x or 2.x for older versions) installed and a modern web browser, preferably Chrome, before you begin.

Setup Instructions

  • Create a new folder on your device named llm_task.
  • Copy index.html and index.js files into the llm_task folder. These are essential for the task's web interface.
  • Download the Gemma 2B model (TensorFlow Lite 2b-it-gpu-int4 or 2b-it-gpu-int8) into the llm_task folder. Alternatively, you can convert an external LLM (like Phi-2, Falcon, or StableLM) for a GPU backend, as only that is currently supported.
  • Open the index.js file in a text editor and update the modelFileName variable with the name of your model file.
  • Run a local HTTP server within the llm_task folder by executing python3 -m http.server 8000 (or python -m SimpleHTTPServer 8000 for older Python versions) in your terminal.
  • Open a web browser and go to http://localhost:8000. The web interface for your LLM task will appear, and the button on the webpage will be enabled after about 10 seconds, indicating the task is ready.

Enjoy exploring the capabilities of your large language model with this simple setup!

on-device-llm-inference-using-mediapipe's People

Contributors

aianytime avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.