From 5c97c84a6f340d2d7c9b6331d25fe3472a9b28ff Mon Sep 17 00:00:00 2001 From: Debanjum Date: Thu, 21 Nov 2024 11:41:48 -0800 Subject: [PATCH] Improve details for projects used in ai with code execution blog post --- src/content/posts/ai-with-code-execution.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/posts/ai-with-code-execution.md b/src/content/posts/ai-with-code-execution.md index db1671c..d8bfca4 100644 --- a/src/content/posts/ai-with-code-execution.md +++ b/src/content/posts/ai-with-code-execution.md @@ -16,9 +16,9 @@ However, these same models excel at writing code. By connecting an LLM to a code ### How it works -We've added an subtask in Khoj that generates Python code to execute in order to fulfill some user intent. This code can be as simple as a mathematical calculation or as complex as charting a graph. The AI assistant then executes this code in a sandboxed environment and returns the results to the user. You can see most of the relevant code in [run_code.py](https://github.com/khoj-ai/khoj/blob/master/src/khoj/processor/tools/run_code.py). +We've added a subtask in Khoj that generates Python code to execute in order to fulfill some user intent. This code can be as simple as a mathematical calculation or as complex as charting a graph. The AI agent then executes this code in a sandboxed environment and returns the results to the user. You can see most of the relevant code in [run_code.py](https://github.com/khoj-ai/khoj/blob/master/src/khoj/processor/tools/run_code.py). -Implementing code execution in AI systems comes with significant security considerations. Running arbitrary LLM-generated Python code, whether on local machines or cloud servers, presents obvious risks that need to be carefully managed. To address these concerns, we've leveraged a sandboxed solution using [Pyodide](https://pyodide.org/). By forking and adapting [Cohere's project Terrarium](https://github.com/cohere-ai/cohere-terrarium), we've developed an independently deployable sandbox in a Docker container, available through [our Terrarium fork on GitHub](https://github.com/khoj-ai/terrarium). Developers can access this functionality using the base image at `ghcr.io/khoj-ai/terrarium:latest`. +Implementing code execution in AI systems comes with significant security considerations. Running arbitrary LLM-generated Python code, whether on local machines or cloud servers, presents obvious risks that need to be carefully managed. To address these concerns, we've leveraged the excellent work done by [Pyoidide](https://pyoidide.org) to run python in a js sandbox and [Cohere's Terrarium](https://github.com/cohere-ai/cohere-terrarium) to containerize it as a service. We've wrapped into a publically accessible docker base image accessible at `ghcr.io/khoj-ai/terrarium:latest`. You can see the code on [our Terrarium fork on GitHub](https://github.com/khoj-ai/terrarium). To run it, you can use the following command: