We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
BUG: too many clients
### Describe the bug
When running the model_ref.generate() function in iPython, there seems to be a client created for every word generation, eventually leading to the following error:

`gaierror: [Errno 8] nodename nor servname provided, or not known`

### To Reproduce

`python -m plexar.deploy.cmdline supervisor -a localhost:9999 --log-level debug`

`python -m plexar.deploy.cmdline worker --supervisor-address localhost:9999 -a localhost:10000 --log-level debug`

```
import sys
from plexar.client import Client
client = Client("localhost:9999")
model_uid = client.launch_model("wizardlm-v1.0",7,"ggmlv3","q4_0")
model_ref = client.get_model(model_uid)


async for c in await model_ref.generate("Once upon a time, there was a very old computer.", {'max_tokens': 512}): sys.stdout.write(c['choices'][0]['text'])
```

### Expected behavior
First the warnings are printed: `Actor caller has created too many clients ([some number] >= 100), the global router may not be set.`

Then we have the gaierror after the `[some number]` exceeds 240.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `plexar/__init__.py`
Content:
```
1 # Copyright 2022-2023 XProbe Inc.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #      http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 
15 
16 from . import _version
17 
18 __version__ = _version.get_versions()["version"]
19 
20 
21 def install():
22     from .model import install as install_model
23 
24     install_model()
25 
26 
27 install()
28 del install
29
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/plexar/__init__.py b/plexar/__init__.py
--- a/plexar/__init__.py
+++ b/plexar/__init__.py
@@ -19,8 +19,12 @@
 
 
 def install():
+    from xoscar.backends.router import Router
+
     from .model import install as install_model
 
+    default_router = Router.get_instance_or_empty()
+    Router.set_instance(default_router)
     install_model()

{"golden_diff": "diff --git a/plexar/__init__.py b/plexar/__init__.py\n--- a/plexar/__init__.py\n+++ b/plexar/__init__.py\n@@ -19,8 +19,12 @@\n \n \n def install():\n+    from xoscar.backends.router import Router\n+\n     from .model import install as install_model\n \n+    default_router = Router.get_instance_or_empty()\n+    Router.set_instance(default_router)\n     install_model()\n", "issue": "BUG: too many clients\n### Describe the bug\r\nWhen running the model_ref.generate() function in iPython, there seems to be a client created for every word generation, eventually leading to the following error:\r\n\r\n`gaierror: [Errno 8] nodename nor servname provided, or not known`\r\n\r\n### To Reproduce\r\n\r\n`python -m plexar.deploy.cmdline supervisor -a localhost:9999 --log-level debug`\r\n\r\n`python -m plexar.deploy.cmdline worker --supervisor-address localhost:9999 -a localhost:10000 --log-level debug`\r\n\r\n```\r\nimport sys\r\nfrom plexar.client import Client\r\nclient = Client(\"localhost:9999\")\r\nmodel_uid = client.launch_model(\"wizardlm-v1.0\",7,\"ggmlv3\",\"q4_0\")\r\nmodel_ref = client.get_model(model_uid)\r\n\r\n\r\nasync for c in await model_ref.generate(\"Once upon a time, there was a very old computer.\", {'max_tokens': 512}): sys.stdout.write(c['choices'][0]['text'])\r\n```\r\n\r\n### Expected behavior\r\nFirst the warnings are printed: `Actor caller has created too many clients ([some number] >= 100), the global router may not be set.`\r\n\r\nThen we have the gaierror after the `[some number]` exceeds 240.\n", "before_files": [{"content": "# Copyright 2022-2023 XProbe Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\nfrom . import _version\n\n__version__ = _version.get_versions()[\"version\"]\n\n\ndef install():\n    from .model import install as install_model\n\n    install_model()\n\n\ninstall()\ndel install\n", "path": "plexar/__init__.py"}], "after_files": [{"content": "# Copyright 2022-2023 XProbe Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\nfrom . import _version\n\n__version__ = _version.get_versions()[\"version\"]\n\n\ndef install():\n    from xoscar.backends.router import Router\n\n    from .model import install as install_model\n\n    default_router = Router.get_instance_or_empty()\n    Router.set_instance(default_router)\n    install_model()\n\n\ninstall()\ndel install\n", "path": "plexar/__init__.py"}]}