├── .github └── workflows │ ├── build-hf-space.yml │ ├── ci.yml │ ├── generate-docs.yml │ └── verify-generated-code.yml ├── .gitignore ├── .gitmodules ├── .npmignore ├── .prettierignore ├── CMakeLists.txt ├── LICENCE ├── README.md ├── README_banner.png ├── assets └── screenshot_0.png ├── cpp ├── actions.hpp ├── generate_glue_prototype.js ├── glue.hpp ├── helpers │ ├── wcommon.cpp │ ├── wcommon.h │ ├── wlog.cpp │ ├── wlog.h │ ├── wsampling.cpp │ └── wsampling.h ├── test_glue.cpp └── wllama.cpp ├── examples ├── basic │ └── index.html ├── embeddings │ └── index.html └── main │ ├── .eslintrc.cjs │ ├── .gitignore │ ├── README.md │ ├── index.html │ ├── package-lock.json │ ├── package.json │ ├── postcss.config.js │ ├── public │ ├── favicon.ico │ └── wllama.png │ ├── src │ ├── App.tsx │ ├── components │ │ ├── ChatScreen.tsx │ │ ├── GuideScreen.tsx │ │ ├── LogScreen.tsx │ │ ├── ModelScreen.tsx │ │ ├── Navbar.tsx │ │ ├── ScreenWrapper.tsx │ │ └── Sidebar.tsx │ ├── config.ts │ ├── index.css │ ├── main.tsx │ ├── utils │ │ ├── benchmark.ts │ │ ├── custom-models.tsx │ │ ├── displayed-model.tsx │ │ ├── messages.context.tsx │ │ ├── nl2br.tsx │ │ ├── types.ts │ │ ├── use-interval-when.ts │ │ ├── utils.ts │ │ └── wllama.context.tsx │ └── vite-env.d.ts │ ├── tailwind.config.cjs │ ├── tsconfig.app.json │ ├── tsconfig.json │ ├── tsconfig.node.json │ └── vite.config.ts ├── guides └── intro-v2.md ├── index.ts ├── package.json ├── scripts ├── build_hf_space.sh ├── build_wasm.sh ├── build_worker.sh ├── docker-compose.yml ├── generate_wasm_from_cdn.js ├── http_server.js └── post_build.sh ├── src ├── cache-manager.ts ├── glue │ ├── glue.ts │ └── messages.ts ├── index.ts ├── mjs.test.ts ├── model-manager.test.ts ├── model-manager.ts ├── multi-thread │ ├── wllama.js │ └── wllama.wasm ├── single-thread │ ├── wllama.js │ └── wllama.wasm ├── utils.test.ts ├── utils.ts ├── wasm-from-cdn.ts ├── wllama.test.ts ├── wllama.ts ├── worker.ts └── workers-code │ ├── generated.ts │ ├── llama-cpp.js │ └── opfs-utils.js ├── tsconfig.build.json ├── tsup.config.ts └── vitest.config.ts /.github/workflows/build-hf-space.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/.github/workflows/build-hf-space.yml -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/.github/workflows/ci.yml -------------------------------------------------------------------------------- /.github/workflows/generate-docs.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/.github/workflows/generate-docs.yml -------------------------------------------------------------------------------- /.github/workflows/verify-generated-code.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/.github/workflows/verify-generated-code.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/.gitignore -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/.gitmodules -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/.npmignore -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/.prettierignore -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/CMakeLists.txt -------------------------------------------------------------------------------- /LICENCE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/LICENCE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/README.md -------------------------------------------------------------------------------- /README_banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/README_banner.png -------------------------------------------------------------------------------- /assets/screenshot_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/assets/screenshot_0.png -------------------------------------------------------------------------------- /cpp/actions.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/cpp/actions.hpp -------------------------------------------------------------------------------- /cpp/generate_glue_prototype.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/cpp/generate_glue_prototype.js -------------------------------------------------------------------------------- /cpp/glue.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/cpp/glue.hpp -------------------------------------------------------------------------------- /cpp/helpers/wcommon.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/cpp/helpers/wcommon.cpp -------------------------------------------------------------------------------- /cpp/helpers/wcommon.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/cpp/helpers/wcommon.h -------------------------------------------------------------------------------- /cpp/helpers/wlog.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/cpp/helpers/wlog.cpp -------------------------------------------------------------------------------- /cpp/helpers/wlog.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/cpp/helpers/wlog.h -------------------------------------------------------------------------------- /cpp/helpers/wsampling.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/cpp/helpers/wsampling.cpp -------------------------------------------------------------------------------- /cpp/helpers/wsampling.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/cpp/helpers/wsampling.h -------------------------------------------------------------------------------- /cpp/test_glue.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/cpp/test_glue.cpp -------------------------------------------------------------------------------- /cpp/wllama.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/cpp/wllama.cpp -------------------------------------------------------------------------------- /examples/basic/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/basic/index.html -------------------------------------------------------------------------------- /examples/embeddings/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/embeddings/index.html -------------------------------------------------------------------------------- /examples/main/.eslintrc.cjs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/.eslintrc.cjs -------------------------------------------------------------------------------- /examples/main/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/.gitignore -------------------------------------------------------------------------------- /examples/main/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/README.md -------------------------------------------------------------------------------- /examples/main/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/index.html -------------------------------------------------------------------------------- /examples/main/package-lock.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/package-lock.json -------------------------------------------------------------------------------- /examples/main/package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/package.json -------------------------------------------------------------------------------- /examples/main/postcss.config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/postcss.config.js -------------------------------------------------------------------------------- /examples/main/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/public/favicon.ico -------------------------------------------------------------------------------- /examples/main/public/wllama.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/public/wllama.png -------------------------------------------------------------------------------- /examples/main/src/App.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/src/App.tsx -------------------------------------------------------------------------------- /examples/main/src/components/ChatScreen.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/src/components/ChatScreen.tsx -------------------------------------------------------------------------------- /examples/main/src/components/GuideScreen.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/src/components/GuideScreen.tsx -------------------------------------------------------------------------------- /examples/main/src/components/LogScreen.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/src/components/LogScreen.tsx -------------------------------------------------------------------------------- /examples/main/src/components/ModelScreen.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/src/components/ModelScreen.tsx -------------------------------------------------------------------------------- /examples/main/src/components/Navbar.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/src/components/Navbar.tsx -------------------------------------------------------------------------------- /examples/main/src/components/ScreenWrapper.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/src/components/ScreenWrapper.tsx -------------------------------------------------------------------------------- /examples/main/src/components/Sidebar.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/src/components/Sidebar.tsx -------------------------------------------------------------------------------- /examples/main/src/config.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/src/config.ts -------------------------------------------------------------------------------- /examples/main/src/index.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/src/index.css -------------------------------------------------------------------------------- /examples/main/src/main.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/src/main.tsx -------------------------------------------------------------------------------- /examples/main/src/utils/benchmark.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/src/utils/benchmark.ts -------------------------------------------------------------------------------- /examples/main/src/utils/custom-models.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/src/utils/custom-models.tsx -------------------------------------------------------------------------------- /examples/main/src/utils/displayed-model.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/src/utils/displayed-model.tsx -------------------------------------------------------------------------------- /examples/main/src/utils/messages.context.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/src/utils/messages.context.tsx -------------------------------------------------------------------------------- /examples/main/src/utils/nl2br.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/src/utils/nl2br.tsx -------------------------------------------------------------------------------- /examples/main/src/utils/types.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/src/utils/types.ts -------------------------------------------------------------------------------- /examples/main/src/utils/use-interval-when.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/src/utils/use-interval-when.ts -------------------------------------------------------------------------------- /examples/main/src/utils/utils.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/src/utils/utils.ts -------------------------------------------------------------------------------- /examples/main/src/utils/wllama.context.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/src/utils/wllama.context.tsx -------------------------------------------------------------------------------- /examples/main/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /examples/main/tailwind.config.cjs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/tailwind.config.cjs -------------------------------------------------------------------------------- /examples/main/tsconfig.app.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/tsconfig.app.json -------------------------------------------------------------------------------- /examples/main/tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/tsconfig.json -------------------------------------------------------------------------------- /examples/main/tsconfig.node.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/tsconfig.node.json -------------------------------------------------------------------------------- /examples/main/vite.config.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/examples/main/vite.config.ts -------------------------------------------------------------------------------- /guides/intro-v2.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/guides/intro-v2.md -------------------------------------------------------------------------------- /index.ts: -------------------------------------------------------------------------------- 1 | export * from './src'; 2 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/package.json -------------------------------------------------------------------------------- /scripts/build_hf_space.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/scripts/build_hf_space.sh -------------------------------------------------------------------------------- /scripts/build_wasm.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/scripts/build_wasm.sh -------------------------------------------------------------------------------- /scripts/build_worker.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/scripts/build_worker.sh -------------------------------------------------------------------------------- /scripts/docker-compose.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/scripts/docker-compose.yml -------------------------------------------------------------------------------- /scripts/generate_wasm_from_cdn.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/scripts/generate_wasm_from_cdn.js -------------------------------------------------------------------------------- /scripts/http_server.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/scripts/http_server.js -------------------------------------------------------------------------------- /scripts/post_build.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/scripts/post_build.sh -------------------------------------------------------------------------------- /src/cache-manager.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/src/cache-manager.ts -------------------------------------------------------------------------------- /src/glue/glue.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/src/glue/glue.ts -------------------------------------------------------------------------------- /src/glue/messages.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/src/glue/messages.ts -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/src/index.ts -------------------------------------------------------------------------------- /src/mjs.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/src/mjs.test.ts -------------------------------------------------------------------------------- /src/model-manager.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/src/model-manager.test.ts -------------------------------------------------------------------------------- /src/model-manager.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/src/model-manager.ts -------------------------------------------------------------------------------- /src/multi-thread/wllama.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/src/multi-thread/wllama.js -------------------------------------------------------------------------------- /src/multi-thread/wllama.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/src/multi-thread/wllama.wasm -------------------------------------------------------------------------------- /src/single-thread/wllama.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/src/single-thread/wllama.js -------------------------------------------------------------------------------- /src/single-thread/wllama.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/src/single-thread/wllama.wasm -------------------------------------------------------------------------------- /src/utils.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/src/utils.test.ts -------------------------------------------------------------------------------- /src/utils.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/src/utils.ts -------------------------------------------------------------------------------- /src/wasm-from-cdn.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/src/wasm-from-cdn.ts -------------------------------------------------------------------------------- /src/wllama.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/src/wllama.test.ts -------------------------------------------------------------------------------- /src/wllama.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/src/wllama.ts -------------------------------------------------------------------------------- /src/worker.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/src/worker.ts -------------------------------------------------------------------------------- /src/workers-code/generated.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/src/workers-code/generated.ts -------------------------------------------------------------------------------- /src/workers-code/llama-cpp.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/src/workers-code/llama-cpp.js -------------------------------------------------------------------------------- /src/workers-code/opfs-utils.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/src/workers-code/opfs-utils.js -------------------------------------------------------------------------------- /tsconfig.build.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/tsconfig.build.json -------------------------------------------------------------------------------- /tsup.config.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/tsup.config.ts -------------------------------------------------------------------------------- /vitest.config.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngxson/wllama/HEAD/vitest.config.ts --------------------------------------------------------------------------------