Skip to content

ariya/nano-jarvis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nano Jarvis

Screenshot

Nano Jarvis is compatible with either a cloud-based (managed) LLM service (e.g. OpenAI GPT model, Grog, OpenRouter, etc) or with a locally hosted LLM server (e.g. llama.cpp, LocalAI, Ollama, etc). Please continue reading for detailed instructions.

Requirement: Node.js v18 or later.

Launch with:

./nano-jarvis.js

then open localhost:5000 with your favorite web browser.

Using Local LLM Servers

Supported local LLM servers include llama.cpp, Jan, Ollama, and LocalAI.

To utilize llama.cpp locally with its inference engine, ensure to load a quantized model such as Gemma 2B, Phi-3 Mini, or LLama-3 8B. Adjust the environment variable LLM_API_BASE_URL accordingly:

llama-server --hf-repo LiteLLMs/gemma-2b-it-GGUF --hf-file Q4_0/Q4_0-00001-of-00001.gguf
export LLM_API_BASE_URL=http://127.0.0.1:8080/v1

To use Jan with its local API server, refer to its documentation and load a model like Phi-3 Mini or LLama-3 8B and set the environment variable LLM_API_BASE_URL:

export LLM_API_BASE_URL=http://127.0.0.1:1337/v1
export LLM_CHAT_MODEL='llama3-8b-instruct'

To use Ollama locally, load a model and configure the environment variable LLM_API_BASE_URL:

ollama pull phi3
export LLM_API_BASE_URL=http://127.0.0.1:11434/v1
export LLM_CHAT_MODEL='phi3'

For LocalAI, initiate its container and adjust the environment variable LLM_API_BASE_URL:

docker run -ti -p 8080:8080 localai/localai tinyllama-chat
export LLM_API_BASE_URL=http://localhost:3928/v1

Using Managed LLM Services

To use OpenAI GPT model, configure the environment variable OPENAI_API_KEY with your API key:

export OPENAI_API_KEY="sk-yourownapikey"

To use OpenRouter, select a model (e.g. Mistral 7B, LLama-3 8B, OpenChat 3.6, etc) and set the environment variables accordingly.

export LLM_API_BASE_URL=https://openrouter.ai/api/v1
export LLM_API_KEY="yourownapikey"
export LLM_CHAT_MODEL="meta-llama/llama-3-8b-instruct"

Nano Jarvis is also compatible with Anyscale, Deep Infra, Fireworks, Groq, Lepton, Novita, Octo, and Together. For details on how to configure the environment variables for each of these services, refer to the documentation of the sister project, Ask LLM.