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

dce-ai

v1.1.2

Published

Harvard DCE's wrapper for AI functionality

Readme

dce-ai

Harvard DCE's wrapper for AI functionality

Usage

// TODO: describe general usage, environment variables, etc.

Choosing an API host

Requests can be sent either straight to OpenAI or through Harvard HUIT's OpenAI relay (AIS OpenAI Direct). The relay is OpenAI-API-compatible, so the same models, structured outputs, and agent tools all work either way – only the base URL and auth header differ. The relay is approved for Level 3 confidential data and bills through a HUIT customer account instead of a credit card.

Pick a host per request:

import { runResponseRequest, APIHost, Models } from 'dce-ai';

const response = await runResponseRequest({
  prompt: 'Summarize this discussion post.',
  task: 'summarize-post',
  model: Models.GPT4_1Mini,
  apiHost: APIHost.HarvardOpenAIRelay,
});

apiKey is still respected and is interpreted as a key for whichever host is selected. runAgentRequest takes the same apiHost option.

Environment variables

| Variable | Purpose | | --- | --- | | OPENAI_API_KEY | API key used when talking to OpenAI directly | | HARVARD_OPENAI_RELAY_API_KEY | API key from the Harvard API Portal, used when talking to the relay | | HARVARD_OPENAI_RELAY_BASE_URL | Optional. Overrides the relay base URL (defaults to https://go.apis.huit.harvard.edu/ais-openai-direct/v2) | | DCE_AI_API_HOST | Optional. Set to OpenAI or HarvardOpenAIRelay to pin the default host for every request |

When apiHost isn't passed, the host is resolved in this order:

  1. DCE_AI_API_HOST, if it names a valid host
  2. The relay, if HARVARD_OPENAI_RELAY_API_KEY is set
  3. OpenAI

The relay wins when both keys are present, since it's the approved path for Level 3 data and bills through HUIT. Setups that only define OPENAI_API_KEY keep going straight to OpenAI, and moving an app onto the relay takes no code changes – just add the relay key. To keep using OpenAI directly on a machine that also has a relay key, set DCE_AI_API_HOST=OpenAI or pass apiHost: APIHost.OpenAI per request.

Notes on the relay

  • Get an API key by registering an app in the Harvard API Portal. A HUIT customer account number (B#####) is required first.
  • Per-app spend limits can be requested in the app description field. Once a limit is hit, the relay returns 429 until the period resets.
  • The default base URL points at v2. v1 is only available through 9/30/26, and budget limits apply separately to v1 and v2.