Skip to content
Muslu Yüksektepe

cem — Compose · Execute · Multiplex

A CLI that gives the planning to a strong AI model and the typing to a cheap one: better decisions at a lower cost.

cem is an open-source command-line tool that runs several AI models together while you write code. Its name comes from the words Compose, Execute and Multiplex. The core idea is that a strong model does the thinking and decision-making, while a cheaper model writes the code. That way you get good decisions without paying premium rates for every line of code.

Purpose

Using AI coding tools every day, I noticed something. The strongest models plan well but are expensive. Cheaper models write code perfectly well when they are told clearly what to do. Having the expensive model do every task end to end meant paying extra for typing work that a cheaper model could also handle.

I built cem to separate those two roles. One model thinks and the other one writes. The user chooses which model takes which role and manages both with a single command.

How it works

cem has three basic modes. You can ask the thinking model alone, give a task to the writing model alone, or run both together in "pair" mode. Pair mode is the real point of the tool. In this mode the thinker is told explicitly not to write the code. It produces a short plan describing which file will change, which function signature to use, which approach to follow and which edge cases to watch for. That plan is handed to the writer with an instruction to implement it without analysing the task again.

That split is what saves money. Without it, both models would solve the whole task and you would pay twice for the same work. When there is nothing to write, meaning the request is not a coding task and the thinker produced no code, cem does not run the writer at all.

A short setup wizard opens on the first run. The user picks a language (Turkish or English), then which AI thinks and which one writes, and finally the model and reasoning effort for each. If a required tool is not installed, cem offers to install it. Input can be given directly on the command line, read from a file, or piped in from another command; for example, a git diff can be sent for review.

Key features

  • It manages AI command-line tools such as Claude, Codex, Cursor and Antigravity from a single interface.
  • It also works with models running locally or on your own server, such as Ollama, LM Studio and unsloth; for these you only give it the server address.
  • The model name is never guessed. cem asks the local server which models it has and refuses to run until one is chosen.
  • Answers from both roles are cached. Asking the same question again does not pay for the same reasoning twice, and the files the writer produced are restored from the cache as well.
  • When restoring from the cache, a file the user has changed in the meantime is never overwritten.
  • Banners, session IDs and internal logs printed by the tools are filtered out, so the user sees only the answer and the prompt passed to the writer does not grow needlessly.
  • With fast mode on, the tools' rules and permission settings are not reloaded on every call. In one case I measured, this cut a call from 124 seconds to 8 seconds.
  • Several API keys can be configured. When one hits its rate limit, cem automatically moves on to the next, so a long session is not interrupted.
  • The cem doctor command checks the setup and shows where you are paying more than you need to.
  • Every run is recorded, and the time spent by each role is shown separately.

Settings and cost control

cem ships with defaults that keep costs low. In pair mode the thinker runs at high effort and the writer at low effort. The user can change these settings globally or for a single project only. Project-specific settings live in a YAML file next to the code and take precedence over the global ones. If a model rejects the chosen effort level, cem tells the user which values it accepts instead of failing silently.

I also planned for environments without a terminal. An IDE plugin, an installer script or a CI environment can configure cem with command-line flags and read its status as machine-readable JSON. That way cem remains the only program that writes its own configuration file.

Technical stack

I wrote cem in Go. Installing it gives you three commands: cem, the orchestrator; cemi, which installs AI command-line tools; and cemir, which removes them. There is a one-line install command for macOS, Linux, WSL and Windows. If a prerequisite such as Node.js is missing, cem offers to install it with the package manager that fits the operating system.

It talks to local model servers over HTTP. Answers stream to the screen as they are produced, because a large local model can spend minutes on a long reply and waiting for the whole answer looks like a hang. Connecting has its own short time limit, so a closed port fails immediately.

On the editor side, there is a plugin for GoLand, PyCharm and the other JetBrains IDEs, published on the JetBrains Marketplace. There is a separate extension for VS Code and Cursor, an MCP server (Model Context Protocol, a protocol that lets AI applications connect to external tools) for Claude Desktop and Continue.dev, and ready-made recipes for Vim, Neovim and Emacs. cem updates the installed AI tools in the background once a day. I number releases by date. The project is released under the MIT licence.

Use cases

  • Individual developers who want to lower the cost of coding with AI.
  • Teams that want to combine a strong model's planning with a cheap or local model's implementation.
  • Developers who do not want their code to leave their network and run models on a GPU server on the local network.
  • Quickly sending a code change for review from the command line.
  • Managing several AI tools and API keys from one place.
Category
AI tools
Year
2026

Technologies

  • Go
  • LLM
  • CLI
  • IntelliJ Plugin
  • Open Source

Links

Back to all projects