This tutorial assumes the reader is familiar with Git, Node, React, and Yarn.
First, clone the LLM React Node app template repository and set it as your current directory.
Before running the app locally, we need to set up an environment file to connect the app's Node server to an LLM. In this example, we'll create an environment file with an API key for OpenAI's language model. To see an example of what the
.env file should look like, see the
.SAMPLE-env file included in the template.
Now we're ready to run the app. We can start it up by installing all its dependent packages and then running the backend and frontend servers.
# install packages
# start the backend server
After starting the backend server, open
http://localhost:3100/ in your browser to confirm the server is running. You'll see the welcome message in your browser.
Now let's start the frontend server. Open a second terminal window in the project's root directory and start the frontend server.
We're ready to check out the app and send prompts to the connected LLM.
http://localhost:5173/ in your browser and you should see a basic input prompt to communicate with your language model.
And now you are up and running 🚀.
Curious for more? Follow us on X (Twitter) to continue the conversation.