whatisgithub

What is llm-calc?

freakynit/llm-calc — explained in plain English

Analysis updated 2026-05-18

1GoAudience · developerComplexity · 1/5Setup · easy

In one sentence

A dependency-free command line calculator designed for AI agents to call so they get accurate scientific-calculator math instead of guessing at arithmetic.

Mindmap

mindmap
  root((llm-calc))
    What it does
      Deterministic math CLI
      Agent tool call target
      Scientific functions
    Tech stack
      Go
    Use cases
      Agent arithmetic delegation
      Script based calculations
      Cross platform binaries
    Audience
      AI agent builders
      Developers
      Script authors

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

What do people build with it?

USE CASE 1

Give an AI agent a reliable way to compute exact arithmetic results

USE CASE 2

Evaluate scientific calculator expressions from a script or CLI

USE CASE 3

Cross compile a single dependency-free calculator binary for multiple platforms

USE CASE 4

Detect calculation failures like division by zero through the program's exit code

What is it built with?

Go

How does it compare?

freakynit/llm-calcadvayc/wrappedaegrail/aegrail-engine
Stars111
LanguageGoGoGo
Setup difficultyeasyeasyhard
Complexity1/52/55/5
Audiencedevelopergeneralops devops

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

How do you get it running?

Difficulty · easy Time to first run · 5min

On macOS and Windows, downloaded binaries may need a security flag cleared before they will run.

So what is it?

llm-calc is a tiny command line calculator built specifically to be called by AI agents and scripts rather than typed by a person. The idea is that language models are not reliable at doing arithmetic themselves, so instead of guessing at a math answer, an agent can hand the expression off to this small program and get back a consistent, correctly computed result every time. It supports the operations you would expect from a scientific calculator: basic addition, subtraction, multiplication, division, remainder, exponents, and factorials, along with common constants like pi and e, and functions such as square root, absolute value, rounding, logarithms, and the standard trigonometric functions, which all work in radians with helper functions to convert to and from degrees. You call it by passing a single quoted mathematical expression as an argument, such as computing the square root of 81 plus the absolute value of negative four, and it prints the numeric result, optionally letting you control how many digits of precision are shown. The tool has no external dependencies and is written in Go, so it can be built with a single Go build command after cloning the repository, and it can also be cross compiled for Linux, macOS, and Windows from any one of those platforms. Pre-built binaries are also available to download directly from the project's releases, though on macOS and Windows you may need to clear a security flag the operating system adds to downloaded files before the program will run. If an expression is invalid, results in dividing by zero, or otherwise cannot produce a normal number, the program exits with a non-zero status so a calling script or agent can detect that something went wrong.

Copy-paste prompts

Prompt 1
Build llm-calc from source and show me how to run a sample expression
Prompt 2
Wire llm-calc into my agent so it delegates math to this CLI instead of computing it itself
Prompt 3
What functions and constants does llm-calc support, and how does factorial handle limits?
Prompt 4
Help me cross compile llm-calc for Linux, macOS, and Windows

Frequently asked questions

What is llm-calc?

A dependency-free command line calculator designed for AI agents to call so they get accurate scientific-calculator math instead of guessing at arithmetic.

What language is llm-calc written in?

Mainly Go. The stack also includes Go.

How hard is llm-calc to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is llm-calc for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.