https://github.com/jbilcke-hf/template-node-llama-express
A minimalist Docker project to get started with Node, llama-node and Express. Ready to be used in a Hugging Face Space.
https://github.com/jbilcke-hf/template-node-llama-express
ai docker huggingface-spaces llama-node llamacpp llm nodejs
Last synced: 11 months ago
JSON representation
A minimalist Docker project to get started with Node, llama-node and Express. Ready to be used in a Hugging Face Space.
- Host: GitHub
- URL: https://github.com/jbilcke-hf/template-node-llama-express
- Owner: jbilcke-hf
- License: apache-2.0
- Created: 2023-06-20T14:10:11.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-21T09:45:37.000Z (over 2 years ago)
- Last Synced: 2025-03-29T19:41:58.467Z (12 months ago)
- Topics: ai, docker, huggingface-spaces, llama-node, llamacpp, llm, nodejs
- Language: TypeScript
- Homepage:
- Size: 22.5 KB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
---
title: Template Node Llama Express
emoji: 🏗️
colorFrom: gray
colorTo: blue
sdk: docker
pinned: false
app_port: 7860
---
A minimalist Docker Space to help people getting started with Node, Express, node-llama and TypeScript
## Installation
### Prerequisites
- Install NVM: https://github.com/nvm-sh/nvm
- Install Docker https://www.docker.com
### Downloading the model
### Building and run without Docker
You need to downloaded yourself `airoboros-13b-gpt4.ggmlv3.q4_0.bin` in the `./models/` folder.
If you plan to change the model, then edit the `modelPath` in `/src/index.mts`` acconrdingly.
```bash
nvm use
npm i
npm run start
```
Then open the generator by passing a prompt in the query parameters:
[http://localhost:7860?prompt=a webpage recipe for making chocolate chip cookies](http://localhost:7860/?prompt=a%20webpage%20recipe%20for%20making%20chocolate%20chip%20cookies)
### Building and running with Docker
Note: the model will be downloaded by Docker,
see the last lines in the Dockerfile.
```bash
npm run docker
```
This script is a shortcut executing the following commands:
```bash
docker build -t template-node-llama-express .
docker run -it -p 7860:7860 template-node-llama-express
```