symmetry-cli 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. package/install.sh +86 -0
  2. package/package.json +1 -1
  3. package/readme.md +2 -2
package/install.sh ADDED
@@ -0,0 +1,86 @@
1
+ #!/bin/sh
2
+ set -e
3
+
4
+ RED='\033[0;31m'
5
+ GREEN='\033[0;32m'
6
+ YELLOW='\033[1;33m'
7
+ NC='\033[0m'
8
+
9
+ print_color() {
10
+ printf '%b%s%b\n' "$1" "$2" "$NC"
11
+ }
12
+
13
+ if ! command -v npm >/dev/null 2>&1; then
14
+ print_color "$RED" "Error: npm is not installed. Please install Node.js and npm first."
15
+ exit 1
16
+ fi
17
+
18
+ print_color "$YELLOW" "Installing symmetry-cli globally..."
19
+ if npm install -g symmetry-cli; then
20
+ print_color "$GREEN" "symmetry-cli installed successfully!"
21
+ else
22
+ print_color "$RED" "Failed to install symmetry-cli. Please check your npm configuration and try again."
23
+ exit 1
24
+ fi
25
+
26
+ print_color "$YELLOW" "Please select an API provider:"
27
+ print_color "$NC" "1) LiteLLM"
28
+ print_color "$NC" "2) LlamaCpp"
29
+ print_color "$NC" "3) LMStudio"
30
+ print_color "$NC" "4) Ollama"
31
+ print_color "$NC" "5) Oobabooga"
32
+ print_color "$NC" "6) OpenWebUI"
33
+
34
+ api_provider=""
35
+ while [ -z "$api_provider" ]; do
36
+ printf "Enter the number of your choice: "
37
+ read -r choice
38
+ case $choice in
39
+ 1) api_provider="litellm" ;;
40
+ 2) api_provider="llamacpp" ;;
41
+ 3) api_provider="lmstudio" ;;
42
+ 4) api_provider="ollama" ;;
43
+ 5) api_provider="oobabooga" ;;
44
+ 6) api_provider="openwebui" ;;
45
+ *) print_color "$RED" "Invalid option. Please try again." ;;
46
+ esac
47
+ done
48
+
49
+ print_color "$YELLOW" "Please enter the model name you want to use:"
50
+ read -r model_name
51
+
52
+ config_dir="$HOME/.config/symmetry"
53
+ provider_yaml="$config_dir/provider.yaml"
54
+
55
+ mkdir -p "$config_dir"
56
+
57
+ if [ ! -f "$provider_yaml" ]; then
58
+ print_color "$YELLOW" "Creating provider.yaml file..."
59
+ cat << EOF > "$provider_yaml"
60
+ # Symmetry Configuration
61
+ apiHostname: localhost
62
+ apiKey:
63
+ apiPath: /v1/chat/completions
64
+ apiPort: 11434
65
+ apiProtocol: http
66
+ apiProvider: $api_provider
67
+ dataCollectionEnabled: true
68
+ maxConnections: 10
69
+ modelName: $model_name
70
+ name: $(whoami)
71
+ path: $config_dir
72
+ public: true
73
+ serverKey: 4b4a9cc325d134dee6679e9407420023531fd7e96c563f6c5d00fd5549b77435
74
+ EOF
75
+ print_color "$GREEN" "provider.yaml created successfully at $provider_yaml"
76
+ else
77
+ print_color "$YELLOW" "provider.yaml already exists at $provider_yaml"
78
+ fi
79
+
80
+ print_color "$GREEN" "Installation complete! You can now run 'symmetry-cli' to start your node."
81
+ print_color "$YELLOW" "Please edit $provider_yaml to customize your provider settings, especially:"
82
+ print_color "$YELLOW" " - apiKey: Add your API key if required"
83
+ print_color "$YELLOW" " - name: Currently set to your system username, change if needed"
84
+ print_color "$YELLOW" " - public: Set to true by default, change to false if you don't want to be publicly accessible"
85
+
86
+ print_color "$YELLOW" "Note: Symmetry is currently in alpha. Connections may be unstable or fail, especially when there are few active providers on the network."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "symmetry-cli",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "",
5
5
  "main": "dist/symmetry.js",
6
6
  "bin": "dist/symmetry.js",
package/readme.md CHANGED
@@ -15,12 +15,12 @@ To call forth Symmetry into your realm, speak these words of power:
15
15
 
16
16
  Linux and MacOs
17
17
  ```
18
- curl -fsSL https://raw.githubusercontent.com/twinnydotdev/symmetry/main/install.sh | sh
18
+ curl -fsSL https://raw.githubusercontent.com/twinnydotdev/symmetry/master/install.sh | sh
19
19
  ```
20
20
 
21
21
  Windows
22
22
  ```
23
- iwr -useb https://raw.githubusercontent.com/twinnydotdev/symmetry/main/install.ps1 | iex
23
+ iwr -useb https://raw.githubusercontent.com/twinnydotdev/symmetry/master/install.ps1 | iex
24
24
  ```
25
25
 
26
26
  ## Usage