npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

open-ended-question-checker

v0.1.0

Published

Verify open-ended survey answers with a local LLM (llama via Ollama). Detects gibberish, off-topic, and low-effort responses.

Downloads

20

Readme

open-ended-question-checker

Verify free-text survey answers with a local LLM. Catches gibberish, off-topic responses, and low-effort filler like "asdf", "n/a", "idk". Zero runtime dependencies. Works offline.

Setup

1. Install Ollama

Download from ollama.com, then pull a model:

ollama pull llama3.1

2. Install the package

npm install open-ended-question-checker

Usage

import { VerifyOpenEndedResponse } from 'open-ended-question-checker';

const results = await VerifyOpenEndedResponse.check([
  { question: 'What did you enjoy most?', answer: 'Fast delivery and helpful support.' },
  { question: 'What did you enjoy most?', answer: 'asdf' },
]);
// [
//   { isValid: true,  score: 0.85, reason: 'Relevant and specific.' },
//   { isValid: false, score: 0.1,  reason: 'Not a meaningful response.' },
// ]

Set module-level defaults once instead of passing options on every call:

VerifyOpenEndedResponse.configure({
  model: 'llama3.2:3b',
  threshold: 0.7,
});

Options

| Option | Default | Env var | Description | | ----------- | ------------------------ | -------------------- | ------------------------------------------------------------- | | ollamaUrl | http://localhost:11434 | OLLAMA_URL | Ollama server URL | | model | llama3.1 | OLLAMA_MODEL | Any model pulled via ollama pull | | threshold | 0.6 | OLLAMA_THRESHOLD | score >= thresholdisValid: true | | timeoutMs | 30000 | OLLAMA_TIMEOUT_MS | Per-call timeout in ms | | language | auto | OLLAMA_LANGUAGE | Language for the reason field. Defaults to answer language. |

Per-call options override configure(), which overrides env vars, which override built-in defaults.

Copy .env.example to .env and uncomment any values you want to change. The library reads env vars at startup — no dotenv dependency is included, so load .env yourself if needed (e.g. node --env-file=.env).

How it works

Uses the LLM-as-judge pattern. Each question/answer pair is sent to Ollama's /api/chat endpoint with a system prompt that scores on five criteria: relevance, coherence, specificity, effort, and language alignment. Ollama's JSON schema mode (≥ 0.5) constrains the model to reply with exactly { score, reason } — no regex parsing, no malformed JSON.

isValid is derived by comparing score to threshold in the library, not by asking the model, so you can adjust strictness without changing the prompt. Temperature is fixed at 0 — identical inputs always produce identical scores.

License

MIT