Skip to content

Commit

Permalink
Update cli-options.md
Browse files Browse the repository at this point in the history
  • Loading branch information
alabulei1 authored Apr 28, 2024
1 parent 6d3d072 commit 27e6570
Showing 1 changed file with 66 additions and 31 deletions.
97 changes: 66 additions & 31 deletions docs/node-guide/cli-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,61 +14,96 @@ You can use `gaianet --help` to check all the available CLI options.
gaianet --help
## Output
Usage: gaianet {config|init|run|stop} [arg]
Usage: gaianet {config|init|run|stop|OPTIONS}
Subcommands:
config <arg> Update the configuration.
Available args: list, chat_url, chat_ctx_size, embedding_url, embedding_ctx_size, prompt_template, port
init [arg] Initialize with optional argument.
Available args: list, paris_guide, mua, gaia, <url-to-config.json>
run Run the program.
start Run the program.
stop [arg] Stop the program.
Available args: --force
config Update the configuration.
init Initialize the GaiaNet node.
run|start Start the GaiaNet node.
stop Stop the GaiaNet node.
Options:
--help Show this help message
--help Show this help message
```

## `gaianet init`

You can use `gaianet init` to download the model files including the chat model like Llama-2-7b and the embedding model like all-MiniLM-L6-v2, the dataset for the RAG application, and init the node.
The `gaianet init` command initializes the node according to the `$HOME/gaianet/config.json` file. You can use some of our [pre-set configurations](https://github.com/GaiaNet-AI/node-configs).

* `gaianet init` will init the default node. It's an RAG application with Gaianet knowledge.
* `gaianet init mua` will init a node with the MUA project knowledge.
* `gaianet init paris` will init a node with the Paris guide knowledge.
* `gaianet init list` to check out all the pre-fixed node settings
* `gainet init --base `
* `gaianet init --config mua` will init a node with the MUA project knowledge.
* `gaianet init --base <path>` will init a node in an alternative directory.

You can also use `gaianet init url_your_config_json` to init your customized settings for the node. You can customize your node using the Gaianet node link. If you're familiar with the Gaianet config.json, you can create your own manually. See an example [here](https://github.com/GaiaNet-AI/gaianet-node/blob/main/config.json).

```
gaianet init https://raw.githubusercontent.com/alabulei1/test-ports/main/config.json
gaianet init --config https://raw.githubusercontent.com/GaiaNet-AI/node-configs/main/pure-llama-3-8b/config.json
```

## `gaianet run`
## `gaianet start`

Use `gaianet run` to start the node after the initialization is done.
The `gaianet start` is to start running the node.

* Use `gaianet start` to start the node according to the `$HOME/gaianet/config.json` file.
* Use `gaianet start --base $HOME/gaianet-2.alt ` to start the node according to the `$HOME/gaianet-2/config.json` file.
* Use `gaianet start --local-only` to start the node for local use according to the `$HOME/gaianet/config.json` file.


## `gaianet stop`

Use `gaianet stop` to stop running the node.
The `gaianet stop` is to stop the running node.

* Use `gaianet stop` to stop running the node.
* Use `gaianet stop --force` to force stop the GaiaNet node.
* Use `gaianet stop --base $HOME/gaianet-2.alt` to stop the node according to the `$HOME/gaianet-2/config.json` file.

## `gaianet config`

The `gaianet config` allows node runner to adjust some parameters in the `config.json` file.
The `gaianet config` can update the key fields defined in the `config.json` file.

* `gaianet config list` will list all the available arguments
* `gaianet config chat <url>` will change the download link of the chat model.
* `gaianet config prompt_template <template>` will change the prompt_template of the chat model.
* `gaianet config chat_ctx_size <size>` will change the context size of the chat model. The default value is 4096.
* `gaianet config embedding <url>` will change the download link of the embedding model.
* `gaianet config embedding_ctx_size <size>` will change the context size of the embedding model. The value here is associated with the embedding model you choose.
* `gaianet config port <port>` will change the port of the Gaianet node API server.
* `gaianet config system_prompt "<prompt>"` will change the system prompt.
* `gaianet config rag_prompt "<prompt>"` will change the rag prompt.
* `gaianet config reverse_prompt "<prompt>"` will change the reverse prompt.
* `gaianet config --help` will list all the available arguments
* `gaianet config --chat-url <url>` will change the download link of the chat model.
* `gaianet config --prompt-template <template>` will change the prompt_template of the chat model.
* `gaianet config --chat-ctx-size <size>` will change the context size of the chat model. The default value is 4096.
* `gaianet config --embedding-url <url>` will change the download link of the embedding model.
* `gaianet config --embedding-ctx-size <size>` will change the context size of the embedding model. The value here is associated with the embedding model you choose.
* `gaianet config --port <port>` will change the port of the Gaianet node API server.
* `gaianet config --system-prompt "<prompt>"` will change the system prompt.
* `gaianet config --rag-prompt "<prompt>"` will change the rag prompt.
* `gaianet config --reverse-prompt "<prompt>"` will change the reverse prompt.
* `gainet config --base <path> ` will modify the `<path>/config.json` parameters.

After you use `gaianet conifg` to change some parameters, please
After you use `gaianet conifg` to change some parameters, please

1. use `gaianet init` to make your settings take effect.
2. use `gaianet run` to start your new node.
2. use `gaianet start` to start your new node.

If you use `gaianet config --base $HOME/gaianet-2.alt` to update some settings, please

1. use `gaianet init --base $HOME/gaianet-2.alt` to make your settings take effect.
2. use `gaianet start --base $HOME/gaianet-2.alt` to start your new node.

The `gaianet config` supports multiple parameters in one command. The example below will change the download link and prompt template of the chat model at the same time.

```
gaianet config --chat-url https://huggingface.co/second-state/gemma-1.1-2b-it-GGUF/resolve/main/gemma-1.1-2b-it-Q5_K_M.gguf --prompt-template gemma-chat
```

The output is the following content

```
[+] Updating the url of chat model ...
* Old url: https://huggingface.co/second-state/Llama-3-8B-Instruct-GGUF/resolve/main/Meta-Llama-3-8B-Instruct-Q5_K_M.gguf
* New url: https://huggingface.co/second-state/gemma-1.1-2b-it-GGUF/resolve/main/gemma-1.1-2b-it-Q5_K_M.gguf
[+] Updating the prompt template of chat model ...
* Old template: llama-3-chat
* New template: gemma-chat
[+] COMPLETED! The config.json is updated successfully.
```

## `--base`

The `--base` is a global subcommand, allowing you to combine it with other commands.

0 comments on commit 27e6570

Please sign in to comment.