{"id":31061538,"url":"https://github.com/parisneo/lollms_legacy","last_synced_at":"2025-09-15T11:11:38.247Z","repository":{"id":171916660,"uuid":"648597454","full_name":"ParisNeo/lollms_legacy","owner":"ParisNeo","description":"Lord of LLMS","archived":false,"fork":false,"pushed_at":"2025-07-23T20:29:17.000Z","size":9414,"stargazers_count":294,"open_issues_count":17,"forks_count":53,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-09-08T01:14:43.965Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ParisNeo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-06-02T10:46:33.000Z","updated_at":"2025-08-21T04:00:13.000Z","dependencies_parsed_at":"2024-11-07T00:22:37.529Z","dependency_job_id":"403d8607-2d6b-4602-a973-e347fc5ed2f5","html_url":"https://github.com/ParisNeo/lollms_legacy","commit_stats":{"total_commits":1336,"total_committers":7,"mean_commits":"190.85714285714286","dds":0.05988023952095811,"last_synced_commit":"3901f0b83c4d65b6100e0b996bbe622744361dd1"},"previous_names":["parisneo/lllm","parisneo/lollms"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ParisNeo/lollms_legacy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParisNeo%2Flollms_legacy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParisNeo%2Flollms_legacy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParisNeo%2Flollms_legacy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParisNeo%2Flollms_legacy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ParisNeo","download_url":"https://codeload.github.com/ParisNeo/lollms_legacy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParisNeo%2Flollms_legacy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275246400,"owners_count":25430813,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-15T02:00:09.272Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-15T11:11:33.261Z","updated_at":"2025-09-15T11:11:38.231Z","avatar_url":"https://github.com/ParisNeo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lord of Large Language Models (LoLLMs)\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/ParisNeo/lollms/blob/main/lollms/assets/logo.png\" alt=\"Logo\" width=\"200\" height=\"200\"\u003e\n\u003c/div\u003e\n\n![GitHub license](https://img.shields.io/github/license/ParisNeo/lollms)\n![GitHub issues](https://img.shields.io/github/issues/ParisNeo/lollms)\n![GitHub stars](https://img.shields.io/github/stars/ParisNeo/lollms)\n![GitHub forks](https://img.shields.io/github/forks/ParisNeo/lollms)\n[![Discord](https://img.shields.io/discord/1092918764925882418?color=7289da\u0026label=Discord\u0026logo=discord\u0026logoColor=ffffff)](https://discord.gg/4rR282WJb6)\n[![Follow me on Twitter](https://img.shields.io/twitter/follow/SpaceNerduino?style=social)](https://twitter.com/SpaceNerduino)\n[![Follow Me on YouTube](https://img.shields.io/badge/Follow%20Me%20on-YouTube-red?style=flat\u0026logo=youtube)](https://www.youtube.com/user/Parisneo)\n[![Downloads](https://static.pepy.tech/badge/lollms)](https://pepy.tech/project/lollms)\n[![Downloads](https://static.pepy.tech/badge/lollms/month)](https://pepy.tech/project/lollms)\n[![Downloads](https://static.pepy.tech/badge/lollms/week)](https://pepy.tech/project/lollms)\n\nLord of Large Language Models (LoLLMs) Server is a text generation server based on large language models. It provides a Flask-based API for generating text using various pre-trained language models. This server is designed to be easy to install and use, allowing developers to integrate powerful text generation capabilities into their applications.\n\n## Features\n\n- Fully integrated library with access to bindings, personalities and helper tools.\n- Generate text using large language models.\n- Supports multiple personalities for generating text with different styles and tones.\n- Real-time text generation with WebSocket-based communication.\n- RESTful API for listing personalities and adding new personalities.\n- Easy integration with various applications and frameworks.\n- Possibility to send files to personalities\n- Possibility to run on multiple nodes and provide a generation service to many outputs at once.\n- Data stays local even in the remote version. Only generations are sent to the host node. The logs, data and discussion history are kept in your local disucssion folder.\n\n## Installation\n\nYou can install LoLLMs using pip, the Python package manager. Open your terminal or command prompt and run the following command:\n\n```bash\npip install --upgrade lollms\n```\n\nOr if you want to get the latest version from the git:\n\n```bash\npip install --upgrade git+https://github.com/ParisNeo/lollms_legacy.git\n```\n\n## GPU support\nIf you want to use cuda. Either install it directly or use conda to install everything:\n```bash\nconda create --name lollms python=3.10\n```\nActivate the environment\n\n```bash\nconda activate lollms\n```\n\nInstall cudatoolkit\n\n```bash\nconda install -c anaconda cudatoolkit\n```\n\nInstall lollms\n\n```bash\npip install --upgrade lollms\n```\n\nNow you are ready.\n\nTo simply configure your environment run the settings app:\n\n```bash\nlollms-settings\n```\n\nThe tool is intuitive and will guide you through configuration process.\n\n\nThe first time you will be prompted to select a binding.\n![image](https://github.com/ParisNeo/lollms/assets/827993/2d7f58fe-089d-4d3e-a21a-0609f8e27969)\n\nOnce the binding is selected, you have to install at least a model. You have two options:\n\n1- install from internet. Just give the link to a model on hugging face. For example. if you select the default llamacpp python bindings (7), you can install this model: \n```bash\nhttps://huggingface.co/TheBloke/airoboros-7b-gpt4-GGML/resolve/main/airoboros-7b-gpt4.ggmlv3.q4_1.bin\n```\n2- install from local drive. Just give the path to a model on your pc. The model will not be copied. We only create a reference to the model. This is useful if you use multiple clients so that you can mutualize your models with other tools. \n\n\nNow you are ready to use the server.\n\n## Library example\n\nHere is the smallest possible example that allows you to use the full potential of the tool with nearly no code\n```python\nfrom lollms.console import Conversation \n\ncv = Conversation(None)\ncv.start_conversation()\n```\nNow you can reimplement the start_conversation method to do the things you want:\n```python\nfrom lollms.console import Conversation \n\nclass MyConversation(Conversation):\n  def __init__(self, cfg=None):\n    super().__init__(cfg, show_welcome_message=False)\n\n  def start_conversation(self):\n    prompt = \"Once apon a time\"\n    def callback(text, type=None):\n        print(text, end=\"\", flush=True)\n        return True\n    print(prompt, end=\"\", flush=True)\n    output = self.safe_generate(prompt, callback=callback)\n\nif __name__ == '__main__':\n  cv = MyConversation()\n  cv.start_conversation()\n```\n\nOr if you want here is a conversation tool written in few lines\n```python\nfrom lollms.console import Conversation \n\nclass MyConversation(Conversation):\n  def __init__(self, cfg=None):\n    super().__init__(cfg, show_welcome_message=False)\n\n  def start_conversation(self):\n    full_discussion=\"\"\n    while True:\n      prompt = input(\"You: \")\n      if prompt==\"exit\":\n        return\n      if prompt==\"menu\":\n        self.menu.main_menu()\n      full_discussion += self.personality.user_message_prefix+prompt+self.personality.link_text\n      full_discussion += self.personality.ai_message_prefix\n      def callback(text, type=None):\n          print(text, end=\"\", flush=True)\n          return True\n      print(self.personality.name+\": \",end=\"\",flush=True)\n      output = self.safe_generate(full_discussion, callback=callback)\n      full_discussion += output.strip()+self.personality.link_text\n      print()\n\nif __name__ == '__main__':\n  cv = MyConversation()\n  cv.start_conversation()\n```\nHere we use the safe_generate method that does all the cropping for you ,so you can chat forever and will never run out of context.\n\n## Socket IO Server Usage\n\nOnce installed, you can start the LoLLMs Server using the `lollms-server` command followed by the desired parameters.\n\n```\nlollms-server --host \u003chost\u003e --port \u003cport\u003e --config \u003cconfig_file\u003e --bindings_path \u003cbindings_path\u003e --personalities_path \u003cpersonalities_path\u003e --models_path \u003cmodels_path\u003e --binding_name \u003cbinding_name\u003e --model_name \u003cmodel_name\u003e --personality_full_name \u003cpersonality_full_name\u003e\n```\n\n### Parameters\n\n- `--host`: The hostname or IP address to bind the server (default: localhost).\n- `--port`: The port number to run the server (default: 9600).\n- `--config`: Path to the configuration file (default: None).\n- `--bindings_path`: The path to the Bindings folder (default: \"./bindings_zoo\").\n- `--personalities_path`: The path to the personalities folder (default: \"./personalities_zoo\").\n- `--models_path`: The path to the models folder (default: \"./models\").\n- `--binding_name`: The default binding to be used (default: \"llama_cpp_official\").\n- `--model_name`: The default model name (default: \"Manticore-13B.ggmlv3.q4_0.bin\").\n- `--personality_full_name`: The full name of the default personality (default: \"personality\").\n\n### Examples\n\nStart the server with default settings:\n\n```\nlollms-server\n```\n\nStart the server on a specific host and port:\n\n```\nlollms-server --host 0.0.0.0 --port 5000\n```\n## API Endpoints\n\n### WebSocket Events\n\n- `connect`: Triggered when a client connects to the server.\n- `disconnect`: Triggered when a client disconnects from the server.\n- `list_personalities`: List all available personalities.\n- `add_personality`: Add a new personality to the server.\n- `generate_text`: Generate text based on the provided prompt and selected personality.\n\n### RESTful API\n\n- `GET /personalities`: List all available personalities.\n- `POST /personalities`: Add a new personality to the server.\n\nSure! Here are examples of how to communicate with the LoLLMs Server using JavaScript and Python.\n\n### JavaScript Example\n\n```javascript\n// Establish a WebSocket connection with the server\nconst socket = io.connect('http://localhost:9600');\n\n// Event: When connected to the server\nsocket.on('connect', () =\u003e {\n  console.log('Connected to the server');\n\n  // Request the list of available personalities\n  socket.emit('list_personalities');\n});\n\n// Event: Receive the list of personalities from the server\nsocket.on('personalities_list', (data) =\u003e {\n  const personalities = data.personalities;\n  console.log('Available Personalities:', personalities);\n\n  // Select a personality and send a text generation request\n  const selectedPersonality = personalities[0];\n  const prompt = 'Once upon a time...';\n  socket.emit('generate_text', { personality: selectedPersonality, prompt: prompt });\n});\n\n// Event: Receive the generated text from the server\nsocket.on('text_generated', (data) =\u003e {\n  const generatedText = data.text;\n  console.log('Generated Text:', generatedText);\n\n  // Do something with the generated text\n});\n\n// Event: When disconnected from the server\nsocket.on('disconnect', () =\u003e {\n  console.log('Disconnected from the server');\n});\n```\n\n### Python Example\n\n```python\nimport socketio\n\n# Create a SocketIO client\nsio = socketio.Client()\n\n# Event: When connected to the server\n@sio.on('connect')\ndef on_connect():\n    print('Connected to the server')\n\n    # Request the list of available personalities\n    sio.emit('list_personalities')\n\n# Event: Receive the list of personalities from the server\n@sio.on('personalities_list')\ndef on_personalities_list(data):\n    personalities = data['personalities']\n    print('Available Personalities:', personalities)\n\n    # Select a personality and send a text generation request\n    selected_personality = personalities[0]\n    prompt = 'Once upon a time...'\n    sio.emit('generate_text', {'personality': selected_personality, 'prompt': prompt})\n\n# Event: Receive the generated text from the server\n@sio.on('text_generated')\ndef on_text_generated(data):\n    generated_text = data['text']\n    print('Generated Text:', generated_text)\n\n    # Do something with the generated text\n\n# Event: When disconnected from the server\n@sio.on('disconnect')\ndef on_disconnect():\n    print('Disconnected from the server')\n\n# Connect to the server\nsio.connect('http://localhost:9600')\n\n# Keep the client running\nsio.wait()\n```\n\nMake sure to have the necessary dependencies installed for the JavaScript and Python examples. For JavaScript, you need the `socket.io-client` package, and for Python, you need the `python-socketio` package.\n\n## Contributing\n\nContributions to the LoLLMs Server project are welcome and appreciated. If you would like to contribute, please follow the guidelines outlined in the [CONTRIBUTING.md](https://github.com/ParisNeo/lollms/blob/main/CONTRIBUTING.md) file.\n\n## License\n\nLoLLMs Server is licensed under the Apache 2.0 License. See the [LICENSE](https://github.com/ParisNeo/lollms/blob/main/LICENSE) file for more information.\n\n## Repository\n\nThe source code for LoLLMs Server can be found on GitHub\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparisneo%2Flollms_legacy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparisneo%2Flollms_legacy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparisneo%2Flollms_legacy/lists"}