Code Interpreter

Execute Python code in a secure sandbox. Let AI write and run code to analyze data, create visualizations, and process files.

Input
# Analyze sales data import pandas as pd import matplotlib.pyplot as plt df = pd.read_csv('sales.csv') monthly = df.groupby('month').sum() monthly.plot(kind='bar')
Output

How It Works

💬

Describe Task

Tell the AI what you want to accomplish in natural language

✍️

AI Writes Code

The model generates Python code to solve your task

Code Executes

Code runs in a secure sandbox and returns results

Quick Start

Python
from mythicdot import MythicDot client = MythicDot() # Create an assistant with code interpreter assistant = client.beta.assistants.create( name="Data Analyst", instructions="You analyze data and create visualizations.", model="mythic-4", tools=[{"type": "code_interpreter"}] ) # Upload a file for analysis file = client.files.create( file=open("data.csv", "rb"), purpose="assistants" ) # Create thread with the file thread = client.beta.threads.create( messages=[{ "role": "user", "content": "Analyze this dataset and create a summary chart", "attachments": [{"file_id": file.id, "tools": [{"type": "code_interpreter"}]}] }] ) # Run and get results run = client.beta.threads.runs.create_and_poll( thread_id=thread.id, assistant_id=assistant.id )

Available Libraries

The sandbox comes pre-installed with popular Python libraries:

pandas
Data analysis
numpy
Numerical computing
matplotlib
Visualization
scipy
Scientific computing
sklearn
Machine learning
seaborn
Statistical viz
pillow
Image processing
sympy
Symbolic math

Use Cases

📊 Data Analysis

Upload CSVs, Excel files, or JSON and get instant insights, statistics, and visualizations.

📈 Chart Generation

Create bar charts, line graphs, scatter plots, and more from your data.

🧮 Math & Calculations

Solve equations, perform statistical analysis, and run numerical simulations.

🔄 File Conversion

Convert between file formats, merge documents, and process data.

🔒 Secure Sandbox

Code runs in an isolated environment with no network access and limited resources. Your data is protected and sessions are ephemeral — files are automatically deleted after the session ends.

Start Analyzing

Upload your data and let AI do the heavy lifting.

Explore Assistants →