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

pi-en2th

v1.0.0

Published

Pi extension for local English-to-Thai assistant response translation with Ollama.

Readme

pi-en2th

pi-en2th is a Pi extension and npm package for local English to Thai assistant response translation with Ollama. It translates assistant responses inside Pi, preserves fenced code blocks, and lets you choose the translation model, style, and output mode.

It is designed for Thai-speaking developers, bilingual workflows, local LLM setups, and markdown-heavy technical conversations where code blocks, commands, and formatting need to stay intact.

Features

  • Local English to Thai translation powered by Ollama
  • Designed for Pi assistant responses
  • Preserves fenced code blocks during translation
  • Supports natural, literal, and technical translation styles
  • Supports append, replace, and thai-only output modes
  • Stores preferences locally in ~/.pi/agent/en2th-translate-config.json
  • Shows a Pi status footer with enabled state, model, style, output mode, and last translation time

Requirements

  • Pi
  • Ollama running locally
  • An Ollama model suitable for English to Thai translation

Default model:

ollama pull translategemma:latest

Installation

Install from npm

pi install npm:pi-en2th

Install from GitHub

pi install https://github.com/jamiejamesdev/pi-en2th.git

Quick Start

  1. Install the extension.
  2. Make sure Ollama is running locally.
  3. Pull a translation model if needed.
  4. Start Pi and use the commands below to configure translation behavior.

Commands

| Command | Description | | --- | --- | | /en2th-toggle | Enable or disable English to Thai translation | | /en2th-model | Choose the Ollama model used for translation | | /en2th-style | Choose the translation style: natural, literal, or technical | | /en2th-output | Choose the output mode: append, replace, or thai-only | | /en2th-status | Show the current translation status |

You can also pass values directly when supported, for example:

/en2th-model translategemma:latest
/en2th-style technical
/en2th-output append

Configuration

Environment Variables

| Variable | Default | Description | | --- | --- | --- | | OLLAMA_BASE_URL | http://localhost:11434 | Base URL for the local Ollama server | | EN2TH_TRANSLATE_MODEL | translategemma:latest | Default Ollama model used for translation |

Local Config File

The extension stores user preferences in:

~/.pi/agent/en2th-translate-config.json

Saved settings include:

  • model
  • enabled
  • style
  • outputMode

Translation Styles

  • natural — smoother Thai phrasing for general reading
  • literal — closer to the English source wording
  • technical — preserves technical terms more strictly

Output Modes

  • append — keeps the original English response and adds the Thai translation below it
  • replace — replaces the original response text with translation notes and the Thai translation
  • thai-only — shows only the Thai translation

Behavior

  • Translates assistant text after the response is generated
  • Leaves non-text content unchanged
  • Preserves fenced code blocks during translation
  • Falls back to the original response if translation fails

Troubleshooting

Ollama is not running

Make sure Ollama is running locally and that OLLAMA_BASE_URL points to the correct host.

Model is not available

Pull a model first or select an installed model:

ollama pull translategemma:latest
/en2th-model translategemma:latest

Translation does not appear

Run /en2th-status to confirm translation is enabled. If translation fails, the extension leaves the original assistant response unchanged.

Publishing

Use this only when releasing a new public npm version:

npm publish --access public