Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
4f118ea
Merge pull request #1 from autogluon/main
HuawenShen May 20, 2025
a0ac09b
merge and update
HuawenShen May 20, 2025
767be68
fix lint
HuawenShen May 20, 2025
26977a8
Save: local changes
HuawenShen May 20, 2025
1fb8552
Merge upstream/main
HuawenShen May 20, 2025
f594790
Modify the CLI UI execution command and debug
HuawenShen May 20, 2025
f781653
webui restore
HuawenShen May 20, 2025
60f909d
finished CLI, updated readme
HuawenShen May 21, 2025
c6cfb26
finished CLI, updated readme
HuawenShen May 21, 2025
8af2796
Merge branch 'webui'
HuawenShen May 21, 2025
5ec6eb3
fix logging attribute error when running run_agent directly
HuawenShen May 21, 2025
fb3b623
fix logging attribute error when running run_agent directly
HuawenShen May 21, 2025
5ba97e6
fix lint
HuawenShen May 22, 2025
29fbc11
WIP: webui
HuawenShen May 27, 2025
10a3137
Merge remote-tracking branch 'upstream/main'
HuawenShen May 27, 2025
42e7c9e
webui
HuawenShen May 27, 2025
2ad93c0
Merge upstream/main
HuawenShen May 27, 2025
b6dfe4d
cliui refactor
HuawenShen May 28, 2025
fc4bbdc
fix
HuawenShen May 28, 2025
671a989
fix
HuawenShen May 28, 2025
a422eca
save
HuawenShen May 30, 2025
912f6c1
small updates
HuawenShen May 30, 2025
a25aefd
save
HuawenShen Jun 3, 2025
51ea3c9
save
HuawenShen Jun 3, 2025
0d13ba7
save
HuawenShen Jun 4, 2025
b6dfbc2
Merge remote-tracking branch 'upstream/main'
HuawenShen Jun 4, 2025
d803fe0
save
HuawenShen Jun 4, 2025
edca00f
save
HuawenShen Jun 5, 2025
3f694d8
save
HuawenShen Jun 5, 2025
762c0bc
no refresh
HuawenShen Jun 5, 2025
c2b48da
save
HuawenShen Jun 5, 2025
bbeeef9
problem
HuawenShen Jun 6, 2025
5fdd7e0
demo
HuawenShen Jun 6, 2025
be1ad3a
save
HuawenShen Jun 6, 2025
763c7cf
save
HuawenShen Jun 6, 2025
a35fd88
Merge remote-tracking branch 'upstream/main'
HuawenShen Jun 7, 2025
b6c9372
save
HuawenShen Jun 7, 2025
4a1e86c
save
HuawenShen Jun 8, 2025
3f3a4da
refactor
HuawenShen Jun 8, 2025
e76e34c
cancel
HuawenShen Jun 8, 2025
3ef321e
save
HuawenShen Jun 9, 2025
39c093d
debug
HuawenShen Jun 9, 2025
2513d2b
save
HuawenShen Jun 10, 2025
9968d7d
save
HuawenShen Jun 10, 2025
b044c85
save
HuawenShen Jun 10, 2025
4b7fa4e
webui 1.0
HuawenShen Jun 10, 2025
d2b2e0c
without --need-user-input
HuawenShen Jun 10, 2025
0de398a
huawens_1
HuawenShen Jun 10, 2025
5aa5949
cancel task version 1
HuawenShen Jun 10, 2025
bab3a2f
cancel2
HuawenShen Jun 10, 2025
267bb1b
save
HuawenShen Jun 10, 2025
23f00d9
iteration prompt without information
HuawenShen Jun 11, 2025
4961b8d
error
HuawenShen Jun 12, 2025
55baf26
flash
HuawenShen Jun 12, 2025
8f113c7
finish iteration prompt
HuawenShen Jun 13, 2025
9ff32f7
Merge remote-tracking branch 'upstream/main'
HuawenShen Jun 15, 2025
4bc4ec6
after merge and debug
HuawenShen Jun 15, 2025
5b443ac
save
HuawenShen Jun 16, 2025
743cdaf
style and prepare for PR
HuawenShen Jun 16, 2025
d2823a7
small fixes
HuawenShen Jun 16, 2025
c61ed8b
save
HuawenShen Jun 16, 2025
56eaeff
bug solved
HuawenShen Jun 16, 2025
cb1b9fe
final change before pr
HuawenShen Jun 16, 2025
39cd5e2
final
HuawenShen Jun 16, 2025
da90812
after lint
HuawenShen Jun 16, 2025
643c81b
pass integration and change lint
HuawenShen Jun 16, 2025
e70d481
small fix
HuawenShen Jun 17, 2025
46f07c7
issue
HuawenShen Jun 17, 2025
49e78de
different providers added
HuawenShen Jun 17, 2025
021aa75
fix
HuawenShen Jun 18, 2025
9b2f7c0
fix
HuawenShen Jun 18, 2025
ab93e49
fix
HuawenShen Jun 18, 2025
dd08184
Merge remote-tracking branch 'upstream/main'
HuawenShen Jun 18, 2025
22a9076
save
HuawenShen Jun 18, 2025
f8a3580
run id not found
HuawenShen Jun 18, 2025
b52b59d
finish job queue
HuawenShen Jun 18, 2025
4fa9340
small fix
HuawenShen Jun 19, 2025
bbedd34
lint
HuawenShen Jun 19, 2025
e11a18d
Merge branch 'main' into main
HuawenShen Jun 19, 2025
dfe814d
Merge branch 'job_queue'
HuawenShen Jun 19, 2025
efa4f3c
Merge remote-tracking branch 'upstream/main'
HuawenShen Jun 19, 2025
a4261c5
small fix
HuawenShen Jun 20, 2025
b9cc607
mcp tested on single machine
HuawenShen Jun 23, 2025
26583ea
depoly service remotely
HuawenShen Jun 24, 2025
aa6ba72
update readme
HuawenShen Jun 25, 2025
d39e8ef
edit runner
HuawenShen Jun 30, 2025
c176c52
withdraw
HuawenShen Jun 30, 2025
b5302ae
update toml
HuawenShen Jun 30, 2025
3914d9b
save
HuawenShen Jul 1, 2025
0b6d2ba
webui templates lg
HuawenShen Jul 1, 2025
037e421
save before changing the structure
HuawenShen Jul 2, 2025
540ed38
change homepage
HuawenShen Jul 2, 2025
7106091
change webui page structure
HuawenShen Jul 3, 2025
a50d037
logo
HuawenShen Jul 3, 2025
e761943
add logo
HuawenShen Jul 3, 2025
fa01f22
del redundent logo and add logo for diff modes
HuawenShen Jul 6, 2025
916785e
save
HuawenShen Jul 7, 2025
88019c3
save
HuawenShen Jul 7, 2025
60dea63
save
HuawenShen Jul 8, 2025
ad3688d
Merge remote-tracking branch 'upstream/main'
HuawenShen Jul 9, 2025
54b319d
merge upstream
HuawenShen Jul 9, 2025
725f9ce
lint
HuawenShen Jul 9, 2025
15aef0f
fix
HuawenShen Jul 9, 2025
d9be53b
updata gitignore
HuawenShen Jul 9, 2025
1591cfa
WIP: added bearer token auth for MCP
HuawenShen Jul 9, 2025
b2cf938
save
HuawenShen Jul 9, 2025
eedb74f
lint
HuawenShen Jul 9, 2025
55de094
save
HuawenShen Jul 10, 2025
01cf8f7
small fix and update readme
HuawenShen Jul 10, 2025
c8b34d4
update entrance
HuawenShen Jul 10, 2025
af048e4
fix
HuawenShen Jul 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 29 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
maab/datasets/
runs/
maab/runs/
/maab/

# OS specific
*.DS_Store
Expand All @@ -21,6 +22,18 @@ cdk.out/
output_*.csv
runs/

# MCP specific
.flask.pid
.mcp.pid
mcp_output/
mcp/__pycache__/
mcp/examples/credentials_template.txt
mcp/examples/example_config.yaml
mcp/*.pyc

# IDE specific
.vscode/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -190,10 +203,21 @@ aga-output-*.csv
# ignore the MLAgent output folder
output/

# MLZero Specific
maab/datasets/
runs/
maab/runs/

# OS specific
*.DS_Store

src/autogluon/mcp/server/.flask.pid
src/autogluon/mcp/server/.mcp.pid
src/autogluon/mcp/server/test_output/
src/autogluon/mcp/server/test_data/
src/autogluon/mcp/server/nohup.out
src/autogluon/mcp/**/uploads/
src/autogluon/mcp/**/mlzero-*/

# Credentials
*.credentials
*.creds
credentials.txt
aws_credentials.txt

.claude
37 changes: 31 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ uv pip install git+https://github.com/autogluon/autogluon-assistant.git

For detailed usage instructions, Anthropic/Azure/OpenAI setup, and advanced configuration options, see our [Getting Started Tutorial](docs/tutorials/getting_started.md).

## API Setup
### 1. API Setup
MLZero uses AWS Bedrock by default. Configure your AWS credentials:

```bash
Expand All @@ -45,17 +45,15 @@ export AWS_SECRET_ACCESS_KEY="<your-secret-key>"

We also support Anthropic, Azure, and OpenAI. Support for more LLM providers (e.g. DeepSeek, etc.) will be added soon.

## Basic Usage

### CLI UI
### 2.1 CLI

![Demo](https://github.com/autogluon/autogluon-assistant/blob/main/docs/assets/cli_demo.gif)

```bash
mlzero -i <input_data_folder> [-u <optional_user_instructions>]
mlzero -i <input_data_folder> [-t <optional_user_instructions>]
```

## WEB UI
### 2.2 Web UI

![Demo](https://github.com/autogluon/autogluon-assistant/blob/main/docs/assets/web_demo.gif)

Expand All @@ -67,6 +65,33 @@ mlzero-frontend # command to start frontend on 8509(default)
1. **Configure**: Set your model provider and credentials in settings
2. **Upload & Describe**: Drag your data folder into the chat input box, then type what you want to accomplish and press Enter

### 2.3 MCP (Model Context Protocol)

Note: The system can run on a single machine or distributed across multiple machines (e.g., server on EC2, client on local).
1. **Start the server**
```bash
cd autogluon-assistant
mlzero-backend # command to start backend
mlzero-mcp-server # This will start the service—run it in a new terminal.
```
2. **Start the client**
```bash
cd autogluon-assistant
mlzero-mcp-client
```
Note: You may need to set up port tunneling to expose your local MCP Client Server (port 8005) if you want to use it with remote LLM services (e.g., Claude API, OpenAI API).

### 2.4 Python API

```python
from autogluon.assistant.coding_agent import run_agent
run_agent(
input_data_folder=<your-input-folder>,
output_folder=<your-output-folder>,
# more args ...
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a commented line:

run_agent(
      input_data_folder=<your-input-folder>,
      output_folder=<your-output-folder>,
      # more args ...
)

```

## Citation
If you use Autogluon Assistant (MLZero) in your research, please cite our paper:

Expand Down
8 changes: 4 additions & 4 deletions docs/tutorials/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ You can select the LLM provider, model, and credentials to use. If using Bedrock
### CLI

```bash
mlzero -i INPUT_DATA_FOLDER [-o OUTPUT_DIR] [-c CONFIG_PATH] [-n MAX_ITERATIONS] [--need-user-input] [-u INITIAL_USER_INPUT] [-e EXTRACT_TO] [-v VERBOSITY_LEVEL]
mlzero -i INPUT_DATA_FOLDER [-o OUTPUT_DIR] [-c CONFIG_PATH] [-n MAX_ITERATIONS] [--ENABLE-PER-ITERATION-INSTRUCTION] [-t --INITIAL-INSTRUCTION] [-e EXTRACT_TO] [-v VERBOSITY_LEVEL]
```

#### Required Arguments
Expand All @@ -89,10 +89,10 @@ mlzero -i INPUT_DATA_FOLDER [-o OUTPUT_DIR] [-c CONFIG_PATH] [-n MAX_ITERATIONS]
- `-n, --max-iterations`:
Maximum number of iterations. Default is `5`.

- `--need-user-input`:
Whether to prompt user input at each iteration. Defaults to `False`.
- `--enable-per-iteration-instruction`:
If enabled, provide an instruction at the start of each iteration (except the first, which uses the initial instruction). The process suspends until you provide it.

- `-u, --user-input`:
- `-t, --initial-instruction`:
Initial user input to use in the first iteration. Optional.

- `-e, --extract-to`:
Expand Down
2 changes: 1 addition & 1 deletion maab/agents/mlzero_default/mlzero_default.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ mlzero \
-o "$OUTPUT_DIR" \
-n 10 \
-v 1 \
-u "complete the task in 10 minutes"
--initial-instruction "complete the task in 10 minutes"

# Check if the process was successful
if [ $? -ne 0 ]; then
Expand Down
11 changes: 9 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,27 @@ dependencies = [
"streamlit-extras>=0.4",
"psutil>=5.9.8",
"peft>=0.15.2",
"fastmcp>=2.0.0",
"aiohttp>=3.8.0",
"requests>=2.28.0",
"boto3>=1.28.0",
"mcp>=0.1.0",
]

[project.scripts]
aga = "autogluon.assistant.cli.app:app"
mlzero = "autogluon.assistant.cli.app:app"
mlzero-webui = "autogluon.assistant.webui.Home:main"
mlzero-backend = "autogluon.assistant.webui.backend.app:main"
mlzero-frontend = "autogluon.assistant.webui.runner:run_frontend"
mlzero-mcp-server = "autogluon.mcp.server.runner:main"
mlzero-mcp-client = "autogluon.mcp.client.server:main"

[project.optional-dependencies]
dev = [
"black>=24",
"GitRepo>=1",
"pytest>=7",
"pytest-asyncio>=0.21.0",
"isort",
"ruff==0.4",
]
Expand All @@ -65,7 +72,7 @@ Homepage = "https://github.com/autogluon/autogluon-assistant"

[tool.setuptools.packages.find]
where = ["src"]
include = ["autogluon.assistant*"]
include = ["autogluon.assistant*", "autogluon.mcp*"]
namespaces = true

[tool.setuptools.package-data]
Expand Down
47 changes: 40 additions & 7 deletions src/autogluon/assistant/cli/app.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
#!/usr/bin/env python3
from __future__ import annotations

import multiprocessing.resource_tracker
from pathlib import Path

import typer

from autogluon.assistant.coding_agent import run_agent

from .. import __file__ as assistant_file

PACKAGE_ROOT = Path(assistant_file).parent
def _noop(*args, **kwargs):
pass


multiprocessing.resource_tracker.register = _noop
multiprocessing.resource_tracker.unregister = _noop
multiprocessing.resource_tracker.ensure_running = _noop

PACKAGE_ROOT = Path(__file__).parent.parent
DEFAULT_CONFIG_PATH = PACKAGE_ROOT / "configs" / "default.yaml"

app = typer.Typer(add_completion=False)
Expand All @@ -31,14 +39,39 @@ def main(
"--config",
help=f"YAML config file (default: {DEFAULT_CONFIG_PATH})",
),
max_iterations: int = typer.Option(5, "-n", "--max-iterations", help="Max iteration count"),
need_user_input: bool = typer.Option(False, "--need-user-input", help="Whether to prompt user each iteration"),
initial_user_input: str | None = typer.Option(None, "-u", "--user-input", help="Initial user input"),
max_iterations: int = typer.Option(
5,
"-n",
"--max-iterations",
help="Max iteration count. If the task hasn’t succeeded after this many iterations, it will terminate.",
),
need_user_input: bool = typer.Option(
False,
"--enable-per-iteration-instruction",
help="If enabled, provide an instruction at the start of each iteration (except the first, which uses the initial instruction). The process suspends until you provide it.",
),
initial_user_input: str | None = typer.Option(
None, "-t", "--initial-instruction", help="You can provide the initial instruction here."
),
extract_archives_to: str | None = typer.Option(
None, "-e", "--extract-to", help="Directory in which to unpack any archives"
None,
"-e",
"--extract-to",
help="Copy input data to specified directory and automatically extract all .zip archives. ",
),
# === Logging parameters ===
verbosity: int = typer.Option(1, "-v", "--verbosity", help="Verbosity level (0–4)"),
verbosity: int = typer.Option(
1,
"-v",
"--verbosity",
help=(
"-v 0: Only includes error messages\n"
"-v 1: Contains key essential information\n"
"-v 2: Includes brief information plus detailed information such as file save locations\n"
"-v 3: Includes info-level information plus all model training related information\n"
"-v 4: Includes full debug information"
),
),
):
"""
mlzero: a CLI for running the AutoMLAgent pipeline.
Expand Down
2 changes: 1 addition & 1 deletion src/autogluon/assistant/coding_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from omegaconf import OmegaConf

from .managers import Manager
from .rich_logging import configure_logging
from .utils import extract_archives

Expand Down Expand Up @@ -45,6 +44,7 @@ def run_agent(
output_dir.mkdir(parents=False, exist_ok=True)

configure_logging(verbosity=verbosity, output_dir=output_dir)
from .managers import Manager

if extract_archives_to is not None:
if extract_archives_to and extract_archives_to != input_data_folder:
Expand Down
1 change: 1 addition & 0 deletions src/autogluon/assistant/rich_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def _configure_logging(console_level: int, output_dir: Path = None) -> None:
console = Console(file=sys.stderr)
console_handler = RichHandler(console=console, markup=True, rich_tracebacks=True)
console_handler.setLevel(console_level)
console_handler.name = CONSOLE_HANDLER
handlers = [console_handler]
else:
stdout_handler = logging.StreamHandler(sys.stdout)
Expand Down
15 changes: 13 additions & 2 deletions src/autogluon/assistant/tools_registry/indexing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import contextlib
import io
import logging
import os
import pickle
from pathlib import Path
from typing import Dict, List, Optional, Tuple
Expand All @@ -11,6 +14,8 @@

logger = logging.getLogger(__name__)

os.environ["TRANSFORMERS_NO_ADVISORY_WARNINGS"] = "true"


class TutorialIndexer:
"""
Expand All @@ -32,6 +37,10 @@ def __del__(self):
"""Cleanup method to properly close the embedding model."""
self.cleanup()

def __silent_encode(self, input):
with contextlib.redirect_stderr(io.StringIO()):
return self.model.encode(input)

def cleanup(self):
"""Cleanup the embedding model to avoid multiprocessing issues."""
if self.model is not None:
Expand All @@ -41,6 +50,8 @@ def cleanup(self):
self.model.close()
elif hasattr(self.model, "stop_multi_process_pool"):
self.model.stop_multi_process_pool()
else:
del self.model
except Exception as e:
logger.debug(f"Error during model cleanup: {e}")
finally:
Expand Down Expand Up @@ -141,7 +152,7 @@ def _build_tool_index(self, tool_name: str, tutorial_type: str) -> Tuple[faiss.I

for i in range(0, len(summaries), batch_size):
batch_summaries = summaries[i : i + batch_size]
batch_embeddings = self.model.encode(batch_summaries)
batch_embeddings = self.__silent_encode(batch_summaries)

# Ensure proper format
if not isinstance(batch_embeddings, np.ndarray):
Expand Down Expand Up @@ -316,7 +327,7 @@ def search(self, query: str, tool_name: str, condensed: bool = False, top_k: int
return []

# Generate query embedding
query_embedding = self.model.encode([query])
query_embedding = self.__silent_encode([query])

# Ensure proper data type and memory layout
if not isinstance(query_embedding, np.ndarray):
Expand Down
56 changes: 0 additions & 56 deletions src/autogluon/assistant/webui/Home.py

This file was deleted.

Loading
Loading