What is Codemode
Codemode is a new feature introduced in Pi 1.0, which allows the large language model (LLM) to express and orchestrate complex operations on the harness side. It essentially provides a way for the LLM to issue tool calls from within a language, in this case, JavaScript. This allows for concurrent operations and basic workflows, which can be helpful in executing tasks that do not make sense in the traditional Pi interface.
For example, coding the generation of images or classification of text with a one-shot classifier model. Codemode runs in the harness, in its own sandbox, and is separate from the execution environment where the tools are executing. This division of systems allows for better security and resource allocation, as the harness and the execution environment can have different levels of trust.
Codemode is especially useful when dealing with programs that cannot be composed as regular tools, such as image generation or classification models.
Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.