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

@inworld/runtime

v1.0.2

Published

`@inworld/runtime` is a Node.js SDK for building AI applications with LLM inference, graph orchestration, speech pipelines, retrieval, tool use, and telemetry.

Readme

Inworld Node.js Runtime SDK

@inworld/runtime is a Node.js SDK for building AI applications with LLM inference, graph orchestration, speech pipelines, retrieval, tool use, and telemetry.

Read the documentation to explore the full platform.

Requirements

  • Node.js 20 or newer

Installation

npm install @inworld/runtime

On supported environments, the package completes native runtime setup during installation.

Quickstart Example

The example below builds and runs a one-node graph locally. It is the simplest way to understand the @inworld/runtime/graph execution model, and it does not require an API key.

import { stopInworldRuntime } from '@inworld/runtime';
import {
  CustomNode,
  GraphBuilder,
  ProcessContext,
} from '@inworld/runtime/graph';

class ReverseTextNode extends CustomNode {
  process(_context: ProcessContext, input: string): string {
    return input.split('').reverse().join('');
  }
}

async function main() {
  const node = new ReverseTextNode();

  const graph = new GraphBuilder({
    id: 'custom_reverse_graph',
    enableRemoteConfig: false,
  })
    .addNode(node)
    .setStartNode(node)
    .setEndNode(node)
    .build();

  const { outputStream } = await graph.start('Hello, Inworld!');
  const result = await outputStream.next();

  await result.processResponse({
    string: (text) => console.log(text),
    default: (value) => console.log(value),
  });
}

main()
  .catch(console.error)
  .finally(async () => {
    await stopInworldRuntime();
  });

Authentication

For remote services such as hosted LLM, STT, and TTS, set your Base64-encoded Runtime API key before running examples. See the authentication guide for details on getting a key.

In the examples below, INWORLD_API_KEY is used as the default credential source for hosted requests. If you pass credentials in request options, those request-level credentials override the default env-backed credentials for that call.

export INWORLD_API_KEY="<your-base64-runtime-api-key>"

Optional advanced environment variables:

  • INWORLD_ADDON_POOL_SIZE: Tunes native addon concurrency for high-throughput workloads

Direct LLM Primitive Example

If you want to call a hosted model directly, use the LLM primitive:

import { stopInworldRuntime } from '@inworld/runtime';
import { LLM } from '@inworld/runtime/primitives/llm';

async function main() {
  const llm = await LLM.create({
    remoteConfig: {
      modelId: 'openai/gpt-4o-mini',
      apiKey: process.env.INWORLD_API_KEY!,
      defaultTimeout: '30s',
      defaultConfig: {
        temperature: 0.7,
        maxNewTokens: 100,
      },
    },
  });

  const response = await llm.generateContentComplete({
    prompt: 'Write a one-sentence welcome to the Inworld Runtime SDK.',
    // Use request-level config when this call needs behavior that differs
    // from the default settings configured when the LLM instance was created.
    config: {
      temperature: 0.6,
      maxNewTokens: 80,
    },
    // Use request-level credentials when this specific call should override
    // the default credentials for the LLM instance, including values that
    // came from environment variables such as INWORLD_API_KEY.
    credentials: {
      inworldApiKey: '<request-scoped-api-key>',
    },
  });

  console.log(response);
}

main()
  .catch(console.error)
  .finally(async () => {
    await stopInworldRuntime();
  });

Choose Your Entry Point

  • @inworld/runtime: Top-level runtime helpers such as stopInworldRuntime()
  • @inworld/runtime/primitives/<primitive>: Direct access to specific primitive subpaths such as @inworld/runtime/primitives/llm, @inworld/runtime/primitives/speech, @inworld/runtime/primitives/knowledge, @inworld/runtime/primitives/mcp, @inworld/runtime/primitives/embeddings, @inworld/runtime/primitives/nlu, and @inworld/runtime/primitives/platform
  • @inworld/runtime/graph: Build orchestrated pipelines with routing, reusable nodes, and realtime agent flows
  • @inworld/runtime/telemetry: Add logging, tracing, and metrics to your runtime workloads

Feature Overview

  • LLM generation for completion, chat, streaming, tool use, and routing
  • Graph-based orchestration for multi-step AI workflows
  • Speech primitives for STT, streaming STT, TTS, VAD, and turn detection
  • Retrieval and embeddings for RAG, knowledge lookup, and intent-driven flows
  • MCP integration for external tool discovery and invocation
  • Safety, goals, and observability patterns for production agents

Templates and Additional Resources

Troubleshooting

  • Verify INWORLD_API_KEY is set when using remote services and that it uses your Base64-encoded Runtime API key
  • Use Node.js 20 or newer when installing and running the package
  • If installation fails, retry in a supported environment with a clean reinstall of @inworld/runtime
  • Call stopInworldRuntime() when your script exits to clean up runtime resources