How can I deploy eligapris/lie-detection-sentiment-analysis?

Hi,

I have used open source models in things like LM-Studio and know some basics, like how to set up a remote server, ssh in, and set up basic things for the server.

I would like to use the model “eligapris/lie-detection-sentiment-analysis” and don’t know how. I am also unable to message the people who made the model since I am new, so I have to use the forum since huggingface doesn’t trust me yet.

Under Deploy and Use this Model, it looks like I can buy server time at a Big Tech company to deploy it. I don’t usually use AWS, but I would really like to test out this model.

I have various statements I would like to test. I am willing to pay some amount, as long as it’s not huge, to test it out. Which server provider is cheapest? Is it AWS?

Can I run it locally somehow also or just rent my own server and deploy it there?

1 Like

Since that model is very lightweight, it might be easier to just use it locally rather than hosting it online…


You can deploy eligapris/lie-detection-sentiment-analysis three practical ways: run locally (cheapest), rent a small VPS (cheapest monthly always-on), or use Hugging Face Inference Endpoints (fastest hosted API, pay per minute). This model is CPU-friendly (0.1B params) and outputs labels like true / false / half-true / mostly-true / barely-true / pants-fire. (Hugging Face)

Also important: it is gated (you must click “Agree” in the browser to share contact info), and it is not deployed by any Inference Provider, so you cannot use “serverless provider inference” for it without deploying it yourself. (Hugging Face)


Background: what this model is (and why LM Studio is not the right tool)

LM Studio is centered around running LLMs in formats like GGUF. This Hugging Face repo is a Transformers text-classification model (RoBERTa). You typically run it with Python (transformers) or host it behind a small HTTP API.

Model caveat: the model card reports ~0.206 accuracy on its validation setup. Treat it as a toy/experiment, not a reliable lie detector. (Hugging Face)


Step 0: get access (required)

Because it is gated, you must request/accept access in your browser first. HF explicitly says requesting access for gated repos can only be done from the browser, and scripts must authenticate with a user token. (Hugging Face)

What to do:

  1. Visit the model page while logged in.

  2. Click Agree to the gating prompt. (Hugging Face)

  3. Create a Hugging Face token (Settings → Access Tokens).

  4. On any machine that will download the model, authenticate with:

    • hf auth login (recommended by HF Hub docs). (Hugging Face)

Pitfall: some gated repos are auto-approved, others require manual approval by authors. HF explains both cases. (Hugging Face)


Option 1: run it locally (recommended first)

This is the fastest way to “test a pile of statements” with near-zero cost.

Local install

Typical Python deps:

  • transformers
  • torch
  • huggingface_hub
  • safetensors

Minimal inference script (batch-friendly)

Key detail: for text classification pipelines, top_k=None returns all labels available in the model config (instead of only the top label). (Hugging Face)

# deps:
#   pip install -U transformers torch huggingface_hub safetensors

import os
from transformers import pipeline

# If you didn't run: hf auth login
# you can also set: export HF_TOKEN=...
# os.environ["HF_TOKEN"] = "hf_..."

clf = pipeline(
    task="text-classification",
    model="eligapris/lie-detection-sentiment-analysis",
    top_k=None,              # get all labels :contentReference[oaicite:8]{index=8}
)

statements = [
    "I never said that.",
    "The Earth orbits the Sun.",
    "I have returned the money already.",
]

results = clf(statements, truncation=True)

for s, r in zip(statements, results):
    print("\nTEXT:", s)
    for item in r:
        print(f"  {item['label']:12s}  {item['score']:.3f}")

What you should expect:

  • Output labels match what the model card shows (truthfulness-style labels). (Hugging Face)
  • This runs fine on CPU.

Option 2: Hugging Face Inference Endpoints (fastest hosted API, low ops)

This is what the “Deploy” button is pushing you toward. It is managed hosting. You do not need to set up AWS yourself. HF manages the infra, you choose AWS/Azure/GCP in their UI. (Hugging Face)

Reality check for this specific repo

The deploy page warns the model is not in the HF Model Catalog and does not come with “verified configuration,” so it “might behave unexpectedly.” (Hugging Face Endpoints)

Cheapest provider inside Inference Endpoints

For CPU instances, HF’s pricing table shows:

  • AWS intel-spr x1: $0.033/hour
  • GCP intel-spr x1: $0.050/hour
  • Azure intel-xeon x1: $0.060/hour (Hugging Face)

So yes, within Hugging Face Inference Endpoints CPU pricing, AWS is the cheapest. (Hugging Face)

Billing detail: prices are shown hourly, but HF charges by the minute, and you’re billed while endpoints are initializing and running. (Hugging Face)

How to keep cost low: enable Scale-to-Zero

HF supports autoscaling down to 0 replicas. When idle for 15 minutes it scales to 0, but the next request will cold-start and can return 502 during initialization, and there is no queueing. (Hugging Face)

Step-by-step in the UI

HF’s “Create an Endpoint” guide lays out the flow:

  1. Enter repo ID and endpoint name
  2. Pick cloud provider and instance type
  3. Enable scale-to-zero
  4. Choose security level
  5. Create
  6. Wait for build and init (often 1–5 minutes)
  7. Test in the UI (Hugging Face)

Call the endpoint (curl)

HF’s “Send Requests” guide shows the pattern: POST JSON with an inputs field and an Authorization Bearer token. (Hugging Face)

You will do the same shape for this model:

curl https://YOUR_ENDPOINT_URL \
  -X POST \
  -H "Authorization: Bearer $HF_TOKEN" \
  -d '{"inputs":"I have never lied in my life."}'

Option 3: rent your own VPS and self-host (cheapest monthly always-on)

If you want something private that you can leave up continuously, a cheap VPS is usually cheaper than Inference Endpoints running 24/7.

Two commonly low-cost examples (public list prices):

  • Hetzner Cloud shows a 2 vCPU, 4 GB, 40 GB option at €3.79/month (some of these cheapest options are ARM). (hetzner.com)
  • OVHcloud VPS lists VPS-1 from US$4.20/month (ex GST) with 4 vCores and 8 GB RAM. (OVHcloud)

What you deploy on the VPS (simple pattern)

  • A small FastAPI app that loads the pipeline once at startup.
  • An /infer endpoint that accepts { "text": "...", "top_k": null }.
  • Run behind uvicorn + systemd.
  • Put Nginx in front and add basic auth or IP allowlisting.

Key security point:

  • Do not embed your HF token in client-side code.
  • Keep HF_TOKEN only on the server as an env var.
    HF even cautions about token leakage for private/gated access in server-side contexts. (Hugging Face)

Which option I would pick for your exact goal

You said: “I have various statements I’d like to test” and “willing to pay some amount, not huge.”

  1. Run locally first. It’s fastest, cheapest, and it confirms gating + labels quickly.
  2. If you want a hosted API for a short window, use Inference Endpoints on AWS CPU x1 and turn on Scale-to-Zero. AWS is the cheapest CPU provider in their table. (Hugging Face)
  3. If you want it always-on for weeks/months, rent a cheap VPS and self-host. OVH and Hetzner are often far cheaper monthly than managed endpoints running 24/7. (OVHcloud)

Common pitfalls

  • Gated access not accepted → downloads fail until you click Agree in browser. (Hugging Face)
  • Scale-to-zero cold starts → first request after idle can return 502 while initializing, no server-side queue. (Hugging Face)
  • Assuming it’s a reliable “lie detector” → reported accuracy is low; treat as experimental scoring. (Hugging Face)
  • Expecting SSH into Inference Endpoints → you cannot access the underlying instance. (Hugging Face)
  • Leaking HF token → keep tokens server-side only for gated models. (Hugging Face)

Quick summary

  • Yes, you can run it locally. That is the best first step. (Hugging Face)
  • Cheapest “big tech” inside HF Inference Endpoints CPU is AWS ($0.033/h for x1). (Hugging Face)
  • Cheapest monthly always-on is usually a VPS (OVH, Hetzner). (OVHcloud)
  • You must handle gating and plan for scale-to-zero cold starts if you use Endpoints. (Hugging Face)