studio/README.md
SMILE Studio is an integrated development environment (IDE) for machine learning and data science using the SMILE library. It combines an interactive notebook, an AI-powered agent panel, a file explorer, and a kernel explorer in a single, modern desktop application. The launcher (
smile/smile.bat) also exposes several command-line entry points. For the User Guide for CLI, see CLI.md.
SMILE Studio brings together four major components in one window:
| Component | Description |
|---|---|
| Notebook | Interactive multi-cell editor supporting Java, Scala, and Python |
| AI Agent Panel | Conversation interface to AI-powered coding and data science agents |
| Project (File) Explorer | File tree of the current working directory |
| Kernel Explorer | Live view of runtime variables, models, and inference services |
All four panels are arranged in a resizable split-pane layout, and the application remembers which notebooks were open across sessions.
Run SMILE Studio from your project's root directory so that relative paths in notebooks resolve correctly:
# Unix / macOS
cd /your/project
path/to/smile/bin/smile
# Windows
cd C:\your\project
path\to\smile\bin\smile
Note: SMILE Studio must be started in a graphical (non-headless) environment. If the JVM is running in headless mode the application will print an error and exit.
--enable-native-access=ALL-UNNAMED for the Java kernel's JShell remote VM)ipython installed for Python notebooks (pip install ipython)┌─────────────────────────────────────────────────────────────────────┐
│ Menu Bar: File | Cell | Help │
│ Toolbar: [New] [Open] [Save] [SaveAs] | [AddCell] [Run] [Clear] │
│ [Restart] [Stop] │
├──────────────────────────────┬──────────────────────────────────────┤
│ Explorer Tabs │ Agent Tabs │
│ ┌──────────┬──────────┐ │ 📊 Clair | ☕ James | 🐍 Guido │
│ │ Project │ Kernel │ │ │
│ └──────────┴──────────┘ │ [Intent input / conversation area] │
│ │ │
│ File tree / Variable tree ├──────────────────────────────────────┤
│ │ Notebook Tabs │
│ │ ┌─────────────────────────────────┐ │
│ │ │ Cell 1: [▶][⏭][▾][↑][↓][🧹][⌦]│ │
│ │ │ [code editor] │ │
│ │ │ [output area] │ │
│ │ ├─────────────────────────────────┤ │
│ │ │ Cell 2 … │ │
│ │ └─────────────────────────────────┘ │
├──────────────────────────────┴──────────────────────────────────────┤
│ Status Bar: [status message] [Heap: 512 MB CPU: 12%] │
└─────────────────────────────────────────────────────────────────────┘
The divider positions are persisted and restored between sessions.
| Action | Description |
|---|---|
| New | Create a new Untitled.java notebook |
| Open… | Open an existing notebook or script file |
| Save | Save the currently active notebook |
| Save As… | Save the active notebook to a new path |
| Auto Save | Toggle periodic auto-save (every 60 seconds) |
| Settings… | Open the AI service configuration dialog |
| Exit | Close all open notebooks (with save prompts) and quit |
| Action | Description |
|---|---|
| Add Cell | Insert a new code cell after the currently focused one |
| Run All | Execute every cell in the active notebook sequentially |
| Clear All | Clear all cell outputs |
| Restart Kernel | Restart the execution engine (confirmation required) |
| Stop | Interrupt the currently running cell |
| Action | Description |
|---|---|
| Tutorials | Open the SMILE quickstart guide in the default browser |
| JavaDocs | Open the SMILE Java API documentation in the browser |
| About | Display version and licensing information |
File > New) — opens a fresh Untitled.java notebook pre-populated with the standard SMILE import block.File > Open…) — file chooser filtered to supported extensions.Previously opened notebooks are restored automatically at startup from .smile/studio.properties in the working directory.
| Extension | Language | Notes |
|---|---|---|
.java | Java | Multi-cell via //--- CELL --- separator |
.jsh | Java (JShell snippet) | Same cell separator |
.scala | Scala | Multi-cell via //--- CELL --- separator |
.sc | Scala (Ammonite script) | Same as .scala |
.py | Python | Multi-cell via #--- CELL --- separator |
.ipynb | Jupyter Notebook | Cells read from / written back to the JSON format |
Jupyter compatibility: When saving a
.ipynbfile, Studio writes back code cells, markdown cells, and raw cells. Cell outputs are not yet persisted to the.ipynbfile.
Each cell is an independent editing unit consisting of:
| Button | Action |
|---|---|
▶ Run | Execute this cell; stay in the current cell |
⏭ Run Below | Execute this cell and all cells below sequentially |
▾ Collapse | Toggle hiding the output area |
↑ Move Up | Swap this cell with the one above |
↓ Move Down | Swap this cell with the one below |
🧹 Clear | Erase this cell's output |
⌦ Delete | Remove this cell (if only one cell remains, clears content instead) |
| Type combobox | Switch between Code / Markdown / Raw cell type |
| Prompt field | Describe what you want and press Enter to generate code via AI |
| Type | Behavior |
|---|---|
| Code | Executed by the kernel; output displayed below |
| Markdown | Rendered as styled HTML when cell is executed |
| Raw | Plain text, not executed or rendered |
| Shortcut | Behavior |
|---|---|
Ctrl + Enter | Run cell, keep focus in current cell |
Shift + Enter | Run cell, move focus to next cell (or create a new one) |
Alt + Enter | Run cell, insert a new cell immediately below |
| Toolbar Run All | Execute all cells top-to-bottom |
Execution is asynchronous; the UI remains responsive while code runs. A second run request while code is executing shows a warning dialog rather than allowing concurrent execution.
Variable values are printed automatically after each successful snippet evaluation:
⇒ DataFrame df = [200 rows × 5 columns]
Errors are highlighted in the output area with pink highlighting.
Both features require an AI service to be configured in Settings.
Press Tab at any non-first line to trigger single-line AI completion. The AI uses the surrounding code context (previous cell + current cell) to suggest a completion. If a completion is in progress, Tab inserts a literal tab character instead.
The generation context includes the text of the previous cell and the existing content of the current cell.
Ctrl + S equivalent → File > Save.java is appended.Enable File > Auto Save to automatically save all open notebooks that have unsaved changes every 60 seconds. Only notebooks that have been previously saved to a file (i.e., have an associated path) are auto-saved; new Untitled notebooks are not.
If a file that is open in the notebook is modified by an external process (e.g., git checkout, another editor), Studio detects the change via a background file-watcher and prompts:
"'filename' has been changed externally. Reload?"
Choosing Yes reloads the file from disk, preserving the tab's position. Choosing No keeps the current in-memory version.
The Java kernel uses the JDK's built-in JShell API running in a separate JVM process. This isolation means:
java.class.path).-XX:MaxMetaspaceSize=1024M, -Xss4M, -XX:MaxRAMPercentage=75, -XX:+UseZGC.FlatLightLaf is automatically initialized in the remote JVM so that smile.plot.swing charts display correctly.| Snippet type | Output |
|---|---|
| Named variable | ⇒ TypeName varName = value |
| Rejected snippet | ✖ Rejected snippet: … |
| Recoverable issue | ⚠ Recoverable issue: … |
| Exception | ExceptionClassName: message followed by stack trace |
When creating a new .java notebook, the first cell is pre-populated with:
import java.awt.Color;
import java.time.*;
import java.util.*;
import static java.lang.Math.*;
import smile.plot.swing.*;
import static smile.swing.SmileUtilities.*;
import org.apache.commons.csv.CSVFormat;
import smile.io.*;
import smile.data.*;
import smile.data.formula.*;
// … and many more SMILE packages
The Scala kernel uses the JSR-223 ScriptEngine API ("scala" engine name). Output is captured by redirecting System.out and System.err around each evaluation. The Scala engine initialization is deferred 5 seconds at startup to avoid capturing LSP/MCP process output.
Returned values are printed as:
$result0: fully.qualified.Type = value
The Python kernel launches an iPython REPL subprocess (ipython --simple-prompt --colors NoColor --no-banner --no-pdb). Multi-line code is submitted via iPython's %cpaste magic. The kernel reads output lines and displays them in the output area.
Prerequisite: iPython must be installed:
pip install ipython
If iPython is not found, Studio shows an informational dialog with the install command.
| Action | How |
|---|---|
| Restart | Cell > Restart Kernel or toolbar ↺ button. Requires confirmation. Clears all outputs. |
| Stop | Cell > Stop or toolbar ⛔ button. Sends an interrupt to the kernel. |
Lines starting with //! inside a Java cell are intercepted before being sent to JShell. The currently supported magic is:
//!mvn groupId:artifactId:version
This resolves the Maven dependency (transitively) via Eclipse Aether and adds the JARs to the JShell classpath at runtime, allowing you to use any Maven artifact without restarting the kernel.
Example:
//!mvn org.apache.commons:commons-math3:3.6.1
The Project tab in the left panel shows the file tree rooted at the current working directory.
.java, .jsh, .scala, .sc, .py, .ipynb) to open it in the notebook.The Kernel tab in the left panel shows a live tree of runtime objects tracked by the active notebook's kernel. Switch between notebooks in the tab strip to refresh the explorer automatically.
The tree has four top-level categories:
| Category | Contents |
|---|---|
| DataFrames | Variables whose type is DataFrame |
| Matrix | Variables whose type contains [] (arrays and matrices) |
| Models | Variables of ML model types (classifiers, regressors, etc.) |
| Services | Persisted model entries registered as inference services |
Double-click any DataFrames or Matrix leaf node to open the variable in a SMILE viewer window:
// Equivalent action generated by Studio:
var dfWindow = smile.swing.SmileUtilities.show(df);
dfWindow.setTitle("df");
Double-click a Models leaf node to open a Save dialog. Studio serializes the selected model variable using smile.io.Write.object(model, path) and saves it to a .sml file. After saving, if the model is a ClassificationModel or RegressionModel, it is automatically registered under the Services node with its schema.
Double-click a Services leaf node to open the Start Service dialog, which configures and launches a REST inference server for the saved model.
The right panel hosts three AI agents, each in its own tab. All agents require an AI service to be configured (see Section 11).
📊 Clair the Analyst — end-to-end ML/AI assistant
Clair handles the complete data science workflow:
☕ James the Java Guru — Java programming assistant
James helps with Java and SMILE-specific code:
Tab)🐍 Guido the Pythonista — Python programming assistant
Guido assists with Python notebooks:
Each intent (conversation turn) has a type selector in the footer:
| Type | Legend | Description |
|---|---|---|
| Instructions | > | Natural language prompt sent to the AI agent |
| Command | / | Slash command (see below) |
| Shell | ! | Shell command executed in a subprocess |
| Raw | — | Display-only entry (not editable) |
Switch the intent type using the combo box, or use the shortcuts below.
Type / followed by a command name and press Ctrl + Enter:
| Command | Description |
|---|---|
/help | List all available slash commands |
/memory show | Display the long-term memory file (SMILE.md) |
/memory add <text> | Append notes to SMILE.md |
/memory edit | Open SMILE.md in a Notepad window |
/memory refresh | Reload SMILE.md from disk into the agent context |
/plan <goal> | Enter plan mode with a stated goal |
/plan off | Exit plan mode |
/compact [instructions] | Summarize the conversation and compact the context window |
/clear | Clear the current conversation session |
/edit <file> | Open a file in the Notepad editor |
/train | Train a machine learning model (runs smile train) |
/predict | Run batch inference (runs smile predict) |
/serve | Start an inference service (runs smile serve) |
Additional custom slash commands can be defined as agent skills in SMILE.md.
Hint window: As you type a slash command, a hint tooltip appears showing the expected arguments.
Set the intent type to Shell (or prefix your input with !) and enter any shell command. On Windows, commands run through powershell.exe -Command; on Unix/macOS, through bash -c. The output is streamed in real time to the output area. A Stop button appears to forcibly terminate long-running processes.
Agents can maintain long-term, project-specific context stored in SMILE.md within the current working directory. This file is automatically loaded into the agent's system prompt. Use /memory add or /memory edit to update it.
Initializing context:
/init
Clair's /init skill creates a SMILE.md file by analysing the project and recording its structure, key decisions, and preferences.
Each intent input shows a Reasoning Effort combo box. The available levels depend on the configured LLM:
| Level | Effect |
|---|---|
| (default) | Provider's default thinking behavior |
low / medium / high | Explicit thinking budget (supported by Anthropic, OpenAI o-series, etc.) |
Increasing reasoning effort produces more careful responses at the cost of higher latency and token usage.
If a conversation session exceeds 180,000 tokens (configurable via the system property smile.agent.auto.compact), the agent automatically runs /compact to summarize the conversation and free context window space.
The Notepad is a standalone text editor window opened for non-notebook files. It is accessible via:
/edit <file> agent command/memory edit command| Feature | Description |
|---|---|
| Syntax highlighting | Detected from file extension (Java, Python, Markdown, SQL, Scala, JSON, YAML, Shell, etc.) |
| Code folding | Enabled for all code languages |
| LSP auto-completion | Triggers on . for Java and Python files |
| Spell checking | English spell checker loaded from data/eng_dic.zip |
| Find / Replace | Ctrl+F (dialog), Ctrl+Shift+F (toolbar), Ctrl+H (replace dialog), Ctrl+Shift+H (replace toolbar) |
| Go To Line | Available in the Search menu |
| Error strip | Right-side gutter with error/warning markers |
| Unsaved change tracking | Prompts before close |
Open via File > Settings…. Choose an AI service provider from the drop-down:
| Provider | Notes |
|---|---|
| OpenAI | GPT models; set API key, optional base URL override, model |
| Azure OpenAI | Legacy Azure endpoint; requires API key, base URL, model |
| Anthropic | Claude models; set API key, optional base URL, model |
| Google Gemini | Gemini models via native API; set API key, model |
| Google Vertex AI | Gemini via Vertex; set API key, base URL, model |
All fields (API key, base URL, model) are stored in Java Preferences (OS keychain / registry). API keys set in Settings take precedence over environment variables.
Supported models are listed as suggestions in each provider's combo box; you can also type any model name manually since the fields are editable.
After clicking OK the new LLM instance is initialized immediately.
Security note: API keys are stored in the JVM
Preferencesstore. On macOS this is the system Keychain; on Windows it is the Registry; on Linux it is~/.java/.userPrefs.
The status bar at the bottom of the window displays:
Ty server initialized Heap: 1.2 GB CPU: 8%
The monospaced font used in all code editors, output areas, and agent intent panes can be resized globally:
| Shortcut | Action |
|---|---|
Ctrl + = | Increase font size |
Ctrl + - | Decrease font size |
The Markdown rendering font size scales proportionally (by ±0.1 em per step).
SMILE Studio automatically connects to MCP servers defined in any of the following configuration files at startup (in order):
$SMILE_HOME/conf/mcp.json~/.smile/mcp.json.smile/mcp.json (project-level, in current working directory)All three files are loaded if they exist; tools from all connected servers become available to agents. Servers are gracefully shut down on application exit.
Example mcp.json:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/your/project"]
},
"web-search": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-brave-search"],
"env": { "BRAVE_API_KEY": "your_key_here" }
}
}
}
SMILE Studio starts two language servers in the background:
| Server | Language | Provides |
|---|---|---|
| Ty | Python | Type checking, diagnostics |
| JDT LS | Java | Completions, hover, diagnostics |
Both servers are started automatically. The jdtls binary is expected at $SMILE_HOME/jdtls/bin/jdtls.
Auto-completion is powered by the LSP providers and activates:
. — immediately triggers member completion for Java and PythonThe completion popup is provided by RSyntaxTextArea's AutoCompletion infrastructure wired to a custom LspCompletionProvider.
SMILE Studio uses FlatLaf for its look-and-feel. The theme is stored in application preferences under the key Theme:
| Value | Description |
|---|---|
Light | FlatLaf Light (default on non-macOS) |
Dark | FlatLaf Dark |
IntelliJ | FlatLaf IntelliJ |
Darcula | FlatLaf Darcula |
macLight | FlatMac Light (default on macOS) |
macDark | FlatMac Dark |
Change the theme by setting the Theme preference (e.g., programmatically or via a custom preference editor) and restarting the application.
JetBrains Mono is installed as the default monospaced font via FlatJetBrainsMonoFont.install().
macOS: Full window content mode and transparent title bar are enabled automatically for a native look.
Windows: Per-monitor DPI scaling is disabled (sun.java2d.uiScale=1.0) to prevent blurry icons.
| Shortcut | Action |
|---|---|
Ctrl + Enter | Run cell, stay |
Shift + Enter | Run cell, go to next / create new |
Alt + Enter | Run cell, insert cell below |
Tab | AI line completion (requires AI service) |
Ctrl + = | Increase font size |
Ctrl + - | Decrease font size |
| Shortcut | Action |
|---|---|
Ctrl + F | Find dialog |
Ctrl + H | Replace dialog |
Ctrl + Shift + F | Find toolbar (inline) |
Ctrl + Shift + H | Replace toolbar (inline) |
Ctrl + G | Go to line |
Ctrl + S | Save file |
. | Trigger LSP auto-completion |
| Shortcut | Action |
|---|---|
Ctrl + Enter | Execute current intent |
| File / Location | Purpose |
|---|---|
.smile/studio.properties (cwd) | List of previously opened file paths, restored at startup |
.smile/SMILE.md or SMILE.md (cwd) | Agent long-term memory / project context |
$SMILE_HOME/conf/mcp.json | Global MCP server definitions |
~/.smile/mcp.json | User-level MCP server definitions |
.smile/mcp.json (cwd) | Project-level MCP server definitions |
Java Preferences node | AI service keys, selected theme, auto-save flag, Markdown font size |
The display environment is not set. On Linux, ensure DISPLAY is set or run through a desktop session. On CI servers, use a virtual display (Xvfb).
Ensure ipython is installed in the Python environment on PATH:
pip install ipython
python -c "import IPython; print(IPython.__version__)"
The Scala script engine needs the smile.home system property and the classpath to include Scala libraries. Ensure you are launching Studio via the provided smile studio script which sets these properties.
Check that $SMILE_HOME/jdtls/bin/jdtls exists and is executable. Errors are logged to the application log and shown briefly in the status bar.
Open File > Settings… and verify your AI provider credentials. Check the status bar for initialization errors. Ensure network access to the provider's API endpoint is available.
If Save shows an error dialog, check file system permissions for the target path. Untitled.java notebooks must be saved via Save As… before auto-save takes effect.
The Kernel Explorer refreshes when you switch notebook tabs. Switch away and back, or run a cell to trigger a refresh. Only named (non-scratch) variables appear; JShell scratch variables (e.g., $1, $2) are excluded.
The remote JVM is allocated up to 75% of the system RAM (-XX:MaxRAMPercentage=75). On memory-constrained machines, reduce this by restarting the kernel after modifying the heap settings via a //! magic in the first cell, or add JVM options in the launch script.
SMILE Studio is free software under the GNU General Public License v3. For commercial use enquiries contact [email protected].