Skip to main content

No project description provided

Project description

Galadriel inference node

Run a Galadriel GPU node to provide LLM inference to the network.

Check out the documentation.

Requirements

Hardware requirements

  • At least 4 CPU cores
  • At least 8GB RAM
  • A supported Nvidia GPU

Software requirements

  • linux (Ubuntu recommended)
  • python (version 3.8+)
  • nvidia drivers, version > 450. nvidia-smi must work

API keys

  • A valid galadriel API key
  • A valid huggingface access token

LLM deployment

To run a Galadriel node, you must first run an LLM.

Create a python environment

python3 -m venv venv
source venv/bin/activate

Install vllm

pip install vllm==0.5.5

Run vllm

HUGGING_FACE_HUB_TOKEN=<HUGGING_FACE_TOKEN> \
  nohup vllm serve neuralmagic/Meta-Llama-3.1-8B-Instruct-FP8 \
  --revision 3aed33c3d2bfa212a137f6c855d79b5426862b24 \
  --max-model-len 8192 \
  --gpu-memory-utilization 1 \
  --host 127.0.0.1 \
  --disable-frontend-multiprocessing \
  --port 11434 > logs_llm.log 2>&1 &

Ensure vllm works

tail -f logs_llm.log

Should see something like INFO: Uvicorn running on http://127.0.0.1:11434

Once you see the API is working try calling it

curl http://localhost:11434/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: a" \
-d '{
    "model": "neuralmagic/Meta-Llama-3.1-8B-Instruct-FP8",
    "messages": [
    {
      "role": "system",
      "content": "You are a helpful assistant."
    },
    {
      "role": "user",
      "content": "Hi, whats up?"
    }
  ]
}'

Run a GPU node from the command line

Create a (separate) python environment

deactivate
mkdir galadriel
cd galadriel
python3 -m venv venv
source venv/bin/activate

Install galadriel-node

pip install galadriel-node

Setup the environment

Only update values that are not the default ones, and make sure to set the API key

galadriel init

Run the node

galadriel node run

If this is your first time running the GPU node, it will perform hardware validation and LLM benchmarking, to ensure your setup is working correctly and is fast enough.

Or run with nohup to run in the background

nohup galadriel node run > logs.log 2>&1 &

Or include .env values in the command

GALADRIEL_LLM_BASE_URL="http://localhost:8000" galadriel node run
# or with nohup
GALADRIEL_LLM_BASE_URL="http://localhost:8000" nohup galadriel node run > logs.log 2>&1 &

Check node status

galadriel node status

Should see status: online

Check node metrics

galadriel node stats

Development

  • Code formatting:

black .

  • Linting:

pylint --rcfile=setup.cfg galadriel_node/*

  • MyPy:

mypy .

  • Unit testing:

python -m pytest tests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

galadriel_node-0.0.7.tar.gz (362.9 kB view details)

Uploaded Source

Built Distribution

galadriel_node-0.0.7-py3-none-any.whl (367.3 kB view details)

Uploaded Python 3

File details

Details for the file galadriel_node-0.0.7.tar.gz.

File metadata

  • Download URL: galadriel_node-0.0.7.tar.gz
  • Upload date:
  • Size: 362.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for galadriel_node-0.0.7.tar.gz
Algorithm Hash digest
SHA256 7fed590ba2e7e532eac85befd0e0d910d2163870aa3d9c716531cc2f315ec16e
MD5 72f0bd8d9e8aaf7fe1c2ed62da613a3a
BLAKE2b-256 551c3f5add653b19cab0307c5880ce13332972feec66b88772aae16ccd1ea46a

See more details on using hashes here.

File details

Details for the file galadriel_node-0.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for galadriel_node-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 fff0b00626e5e7968da41f812c2f14314455c3ef4f361e5cc1468a2a983969f1
MD5 0462974ce780b8421a8a20e4becab79f
BLAKE2b-256 fc9b20d9cea74fa3f6717a9bc91c06c499992717305fc008a5e8e35ef6a66595

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page