gitwtfhub

wtf is sting?

abod707/sting — explained in plain English

Analysis updated 2026-05-18

2RustAudience · developerComplexity · 3/5Setup · moderate

TL;DR

A Rust CLI that turns plain English requests into Termux phone-control commands using a small on-device AI model, fully offline.

Mindmap

mindmap
  root((sting))
    What it does
      Plain English to Termux commands
      Runs on-device
      No cloud
    Tech stack
      Rust
      candle
      Termux
    Use cases
      Control phone hardware
      Power AI agent tool use
      Add custom tools
    Audience
      Developers
      AI agent builders
    Safety
      Constrained decoding
      Confirmation prompts
      No shell injection

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Control phone hardware like flashlight, vibration, or notifications from Termux using plain English commands.

REASON 2

Give a larger AI agent a reliable, validated way to issue device-control commands without hallucinated flags.

REASON 3

Add custom CLI tools to the config file so the model can control other programs on the phone.

What's in the stack?

RustTermuxcandleSentencePiece

How it stacks up

abod707/sting132ikl/game1lystore/pay-dcp
Stars222
LanguageRustRustRust
Last pushed2020-12-30
MaintenanceDormant
Setup difficultymoderatemoderatemoderate
Complexity3/52/53/5
Audiencedevelopergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 30min

Requires Termux plus the separate Termux:API app, and a several-minute on-device Rust build.

The base model is MIT licensed, the README does not state the license for the sting project itself.

Wtf does this do

Sting is a command line tool that lets you control your Android phone's hardware from Termux by typing plain English requests, such as turning on the flashlight, sending a notification, or reading a sensor. Instead of remembering exact command syntax, you type what you want and a small on-device AI model translates it into the correct Termux command with the right arguments. The tool is written in Rust and runs a 26 million parameter model entirely on the phone. There is no cloud service and no server involved, everything happens locally after you install a single binary plus about 52 megabytes of model weights. The model was trained specifically on the set of commands the Termux:API package provides, so it understands requests like adjusting brightness, checking battery level, or vibrating the device for a set time. Safety is built into how commands are executed. Every command is built as a plain list of arguments rather than run through a shell, which avoids a common class of security bugs. The tool also asks for confirmation before running a command unless you explicitly skip that step, and sensitive actions like reading text messages or contacts are not included by default. You can teach sting new tools by adding entries to a tools.json configuration file, describing a command's name, what it does, and its parameters, and the model will generalize to new tools reasonably well. For heavier use of custom tools, the project explains how to further train the model on your own examples. Beyond direct phone control, sting is also designed to work as a building block for other AI agents. A larger AI system can hand off a plain English instruction, and sting turns it into a validated command with no invalid options possible, since the decoding process is constrained to only produce commands and arguments that actually exist. The project also doubles as a teaching example for people learning Rust, with a companion guide mapping parts of the code to standard Rust learning material.

Yoink these prompts

Prompt 1
Explain how the retrieval head narrows down which tools get passed to the model before decoding.
Prompt 2
Walk me through how sting's constrained decoding guarantees it never emits an invalid command or flag.
Prompt 3
Show me how to add a new custom tool to tools.json so sting can control it.
Prompt 4
Explain how the KV-cached decoding in this repo keeps inference fast on a phone CPU.

Frequently asked questions

wtf is sting?

A Rust CLI that turns plain English requests into Termux phone-control commands using a small on-device AI model, fully offline.

What language is sting written in?

Mainly Rust. The stack also includes Rust, Termux, candle.

What license does sting use?

The base model is MIT licensed, the README does not state the license for the sting project itself.

How hard is sting to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is sting for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.