Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ To allow the API to be accessible from other machines, add the argument `--host
parallax run --host 0.0.0.0
```

When running `parallax run` for the first time or after an update, some basic info (like version and gpu name) might be sent to help improve the project. To disable this, use the `-u` flag:
When running `parallax run` for the first time or after an update, the code version info might be sent to help improve the project. To disable this, use the `-u` flag:
```sh
parallax run -u
```
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ dependencies = [
"uvloop",
"fastapi",
"pydantic",
"py-machineid",
"protobuf==6.31.1",
"dijkstar==2.6.0",
"lattica==1.0.9",
Expand Down
32 changes: 3 additions & 29 deletions src/parallax/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
import subprocess
import sys

import machineid
import requests

from parallax.server.server_info import HardwareInfo
from parallax_utils.file_util import get_project_root
from parallax_utils.logging_config import get_logger
from parallax_utils.version_check import get_current_version
Expand Down Expand Up @@ -297,40 +295,16 @@ def chat_command(args, passthrough_args: list[str] | None = None):
_execute_with_graceful_shutdown(cmd)


def collect_machine_info():
"""Collect machine information."""
version = get_current_version()
device_uuid = str(machineid.id())
try:
hw = HardwareInfo.detect()
return {
"uuid": device_uuid,
"version": version,
"gpu": hw.chip,
}
except Exception:
return {
"uuid": device_uuid,
"version": version,
"gpu": "unknown",
}


def update_package_info():
"""Update package information."""
usage_info = collect_machine_info()
version = get_current_version()

try:
package_info = load_package_info()
if (
package_info is not None
and package_info["uuid"] == usage_info["uuid"]
and package_info["version"] == usage_info["version"]
and package_info["gpu"] == usage_info["gpu"]
):
if package_info is not None and package_info["version"] == version:
return

save_package_info(usage_info)
save_package_info({"version": version})
except Exception:
pass

Expand Down