Added smart model routing
30
README.md
@ -44,6 +44,7 @@ As an all-encompassing tool with access to over 500 AI expert conditioning acros
|
||||
- Support for LM Studio as a backend
|
||||
- Support for Ollama as a backend
|
||||
- Support for vllm as a backend
|
||||
- Support for prompt Routing to various models depending on the complexity of the task
|
||||
|
||||
## Star History
|
||||
|
||||
@ -71,6 +72,35 @@ The installation scripts are:
|
||||
### Manual install:
|
||||
Since v 9.4, it is not advised to do manual install as many services require the creation of a separate environment and lollms needs to have complete control on the environments. So If you install it using your own conda setup, you will not be able to install any service and reduce the use of lollms to the chat interface (no xtts, no comfyui, no fast generation through vllm or petals or soever)
|
||||
|
||||
## Smart Routing: Optimizing for Money and Speed
|
||||
|
||||
Lollms' Smart Routing feature goes beyond just selecting the right model for accuracy. It empowers you to optimize your text generation process for two key factors: **money** and **speed**.
|
||||
|
||||
**Optimizing for Money:**
|
||||
|
||||
Imagine you're using multiple text generation services with varying price points. Some models might be exceptionally powerful but come with a hefty price tag, while others offer a more budget-friendly option with slightly less capability. Smart Routing lets you leverage this price difference to your advantage:
|
||||
|
||||
* **Cost-Effective Selection:** By defining a hierarchy of models based on their cost, Smart Routing can automatically choose the most economical model for your prompt. This ensures you're only paying for the power you need, minimizing unnecessary expenses.
|
||||
* **Dynamic Price Adjustment:** As your prompt complexity changes, Smart Routing can dynamically switch between models, ensuring you're always using the most cost-effective option for the task at hand.
|
||||
|
||||
**Optimizing for Speed:**
|
||||
|
||||
Speed is another critical factor in text generation, especially when dealing with large volumes of content or time-sensitive tasks. Smart Routing allows you to prioritize speed by:
|
||||
|
||||
* **Prioritizing Smaller Models:** By placing faster, less resource-intensive models higher in the hierarchy, Smart Routing can prioritize speed for simple prompts. This ensures quick responses and efficient processing.
|
||||
* **Dynamic Speed Adjustment:** For more complex prompts requiring the power of larger models, Smart Routing can seamlessly switch to those models while maintaining a balance between speed and accuracy.
|
||||
|
||||
**Example Use Cases:**
|
||||
|
||||
* **Content Marketing:** Use Smart Routing to select the most cost-effective model for generating large volumes of blog posts or social media content.
|
||||
* **Customer Support:** Prioritize speed by using smaller models for quick responses to frequently asked questions, while leveraging more powerful models for complex inquiries.
|
||||
* **Research and Development:** Optimize for both money and speed by using a tiered model hierarchy, ensuring you can quickly generate initial drafts while using more powerful models for in-depth analysis.
|
||||
|
||||
**Conclusion:**
|
||||
|
||||
Smart Routing is a versatile tool that empowers you to optimize your text generation process for both cost and speed. By leveraging a hierarchy of models and dynamically adjusting your selection based on prompt complexity, you can achieve the perfect balance between efficiency, accuracy, and cost-effectiveness.
|
||||
|
||||
|
||||
# Code of conduct
|
||||
|
||||
By using this tool, users agree to follow these guidelines :
|
||||
|
7
app.py
@ -35,7 +35,7 @@ if not PackageManager.check_package_installed_with_version("freedom_search", exp
|
||||
PackageManager.install_or_update("freedom-search")
|
||||
ASCIIColors.success("OK")
|
||||
|
||||
expected_scrapemaster_version = "0.1.5"
|
||||
expected_scrapemaster_version = "0.1.6"
|
||||
ASCIIColors.yellow(f"Checking scrapemaster ({expected_scrapemaster_version}) ...", end="", flush=True)
|
||||
if not PackageManager.check_package_installed_with_version("scrapemaster", expected_scrapemaster_version):
|
||||
PackageManager.install_or_update("scrapemaster")
|
||||
@ -208,7 +208,8 @@ if __name__ == "__main__":
|
||||
from lollms.server.endpoints.lollms_vllm import router as lollms_vllm_router
|
||||
from lollms.server.endpoints.lollms_motion_ctrl import router as lollms_motion_ctrl_router
|
||||
from lollms.server.endpoints.lollms_discussion import router as lollms_discussion_router
|
||||
from lollms.server.endpoints.lollms_petals import router as lollms_petals_router
|
||||
from lollms.server.endpoints.lollms_petals import router as lollms_petals_router
|
||||
from lollms.server.endpoints.lollms_rag import router as lollms_rag_router
|
||||
|
||||
|
||||
from endpoints.lollms_webui_infos import router as lollms_webui_infos_router
|
||||
@ -268,6 +269,8 @@ if __name__ == "__main__":
|
||||
|
||||
app.include_router(lollms_ollama_router)
|
||||
app.include_router(lollms_petals_router)
|
||||
|
||||
app.include_router(lollms_rag_router)
|
||||
app.include_router(lollms_vllm_router)
|
||||
app.include_router(lollms_motion_ctrl_router)
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# =================== Lord Of Large Language Multimodal Systems Configuration file ===========================
|
||||
version: 129
|
||||
version: 131
|
||||
binding_name: null
|
||||
model_name: null
|
||||
model_variant: null
|
||||
@ -218,13 +218,23 @@ petals_device: cuda
|
||||
|
||||
# lollms service
|
||||
enable_lollms_service: false
|
||||
lollms_base_url: http://localhost:1234
|
||||
lollms_access_keys : "" # set a list of keys separated by coma to restrict access
|
||||
lollms_access_keys : [] # set a list of keys separated by coma to restrict access
|
||||
activate_lollms_server: true
|
||||
activate_lollms_rag_server: true
|
||||
activate_lollms_tts_server: true
|
||||
activate_lollms_stt_server: true
|
||||
activate_lollms_tti_server: true
|
||||
activate_lollms_itt_server: true
|
||||
activate_lollms_ttm_server: true
|
||||
activate_ollama_emulator: true
|
||||
activate_openai_emulator: true
|
||||
activate_mistralai_emulator: true
|
||||
|
||||
use_smart_routing: false
|
||||
smart_routing_router_model : ""
|
||||
smart_routing_models_by_power : []
|
||||
|
||||
|
||||
# elastic search service
|
||||
elastic_search_service: false
|
||||
elastic_search_url: http://localhost:9200
|
||||
|
84
docs/rag/README.md
Normal file
@ -0,0 +1,84 @@
|
||||
# LOLLMS RAG System
|
||||
|
||||
## Overview
|
||||
|
||||
The LOLLMS RAG (Retrieval-Augmented Generation) System is a powerful tool that combines a FastAPI backend with a JavaScript client to provide efficient document management and search capabilities. This system allows users to add, remove, index, and search documents using vector embeddings, enhancing the retrieval process for various applications.
|
||||
|
||||
## Components
|
||||
|
||||
1. **Python Backend (`lollms_rag.py`)**: A FastAPI-based server that handles document management, indexing, and search operations.
|
||||
2. **JavaScript Client (`LOLMSRAGClient`)**: A client-side class that interacts with the backend API, providing an easy-to-use interface for developers.
|
||||
|
||||
## Features
|
||||
|
||||
- Secure authentication using bearer tokens
|
||||
- Document management (add, remove, index)
|
||||
- Vector-based document search
|
||||
- Database wiping capability
|
||||
- Cross-platform compatibility
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Python 3.7+
|
||||
- FastAPI
|
||||
- LOLLMS WebUI
|
||||
- Pydantic
|
||||
- lollmsvectordb
|
||||
- JavaScript environment (for client-side usage)
|
||||
|
||||
## Installation
|
||||
Just install, configure and run lollms and import your client inside your webapp. By default the url should be http://localhost:9600/lollms_js. If you have changed the host name or port address, just change this to whatever you have built. Once imported you are ready to use the rag functionalities in your lollms webapp.
|
||||
|
||||
## Usage
|
||||
|
||||
### Python Backend
|
||||
|
||||
1. Include the `lollms_rag.py` module in your FastAPI application.
|
||||
2. Configure the LOLLMS WebUI instance with appropriate RAG settings.
|
||||
3. Add the router to your FastAPI app:
|
||||
```python
|
||||
from lollms_rag import router as rag_router
|
||||
|
||||
app.include_router(rag_router)
|
||||
```
|
||||
|
||||
### JavaScript Client
|
||||
|
||||
1. Include the `LOLMSRAGClient` class in your JavaScript project.
|
||||
2. Create an instance of the client:
|
||||
```javascript
|
||||
const ragClient = new LOLMSRAGClient('http://your-api-url', 'your-bearer-token');
|
||||
```
|
||||
|
||||
3. Use the client methods to interact with the RAG system:
|
||||
```javascript
|
||||
// Add a document
|
||||
ragClient.addDocument('Title', 'Content', 'path/to/document')
|
||||
.then(response => console.log(response))
|
||||
.catch(error => console.error(error));
|
||||
|
||||
// Search for documents
|
||||
ragClient.search('query text')
|
||||
.then(results => console.log(results))
|
||||
.catch(error => console.error(error));
|
||||
```
|
||||
|
||||
## API Endpoints
|
||||
|
||||
- `POST /add_document`: Add a new document
|
||||
- `POST /remove_document/{document_id}`: Remove a document
|
||||
- `POST /index_database`: Index the database
|
||||
- `POST /search`: Search for documents
|
||||
- `DELETE /wipe_database`: Wipe the entire database
|
||||
|
||||
## Security
|
||||
|
||||
The system uses bearer token authentication. Ensure that you keep your API keys secure and don't expose them in client-side code.
|
||||
|
||||
## Contributing
|
||||
|
||||
Contributions are welcome! Please feel free to submit a Pull Request.
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the [Apache 2.0](LICENSE).
|
@ -586,3 +586,64 @@ extractCodeBlocks(text) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
class LOLLMSRAGClient {
|
||||
constructor(baseURL, apiKey) {
|
||||
this.baseURL = baseURL;
|
||||
this.apiKey = apiKey;
|
||||
}
|
||||
|
||||
async request(endpoint, method = 'GET', body = null) {
|
||||
const headers = {
|
||||
'Authorization': this.apiKey,
|
||||
'Content-Type': 'application/json',
|
||||
};
|
||||
|
||||
const options = {
|
||||
method,
|
||||
headers,
|
||||
};
|
||||
|
||||
if (body) {
|
||||
options.body = JSON.stringify(body);
|
||||
}
|
||||
|
||||
const response = await fetch(`${this.baseURL}${endpoint}`, options);
|
||||
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json();
|
||||
throw new Error(`Error: ${errorData.detail || response.statusText}`);
|
||||
}
|
||||
|
||||
return response.json();
|
||||
}
|
||||
|
||||
async addDocument(title, content, path = "unknown") {
|
||||
const document = { title, content, path };
|
||||
return this.request('/add_document', 'POST', document);
|
||||
}
|
||||
|
||||
async removeDocument(documentId) {
|
||||
return this.request(`/remove_document/${documentId}`, 'POST');
|
||||
}
|
||||
|
||||
async indexDatabase() {
|
||||
return this.request('/index_database', 'POST');
|
||||
}
|
||||
|
||||
async search(query) {
|
||||
const searchQuery = { query };
|
||||
return this.request('/search', 'POST', searchQuery);
|
||||
}
|
||||
|
||||
async wipeDatabase() {
|
||||
return this.request('/wipe_database', 'DELETE');
|
||||
}
|
||||
}
|
||||
|
||||
// Example usage:
|
||||
// const ragClient = new RAGClient('http://localhost:8000', 'your_bearer_token');
|
||||
// ragClient.addDocument('My Title', 'This is the content of the document.')
|
||||
// .then(response => console.log(response))
|
||||
// .catch(error => console.error(error));
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit ccf237faba17935efd1e8ecbbf12f494c837333b
|
||||
Subproject commit 53edc1e8ceb20b565267feefb6f626bd6748ade7
|
@ -910,7 +910,7 @@ class LOLLMSWebUI(LOLLMSElfServer):
|
||||
}, to=client_id
|
||||
)
|
||||
)
|
||||
if msg_type != MSG_TYPE.MSG_TYPE_INFO:
|
||||
if msg_type and msg_type.value < MSG_TYPE.MSG_TYPE_INFO.value:
|
||||
client.discussion.update_message(client.generated_text, new_metadata=mtdt, new_ui=ui, started_generating_at=client.discussion.current_message.started_generating_at, nb_tokens=client.discussion.current_message.nb_tokens)
|
||||
|
||||
|
||||
@ -1053,7 +1053,7 @@ class LOLLMSWebUI(LOLLMSElfServer):
|
||||
return False
|
||||
|
||||
# Stream the generated text to the main process
|
||||
elif message_type == MSG_TYPE.MSG_TYPE_FULL:
|
||||
elif message_type in [MSG_TYPE.MSG_TYPE_FULL, MSG_TYPE.MSG_TYPE_FULL_INVISIBLE_TO_AI, MSG_TYPE.MSG_TYPE_FULL_INVISIBLE_TO_USER]:
|
||||
if self.nb_received_tokens==0:
|
||||
self.start_time = datetime.now()
|
||||
try:
|
||||
@ -1067,7 +1067,7 @@ class LOLLMSWebUI(LOLLMSElfServer):
|
||||
if antiprompt:
|
||||
ASCIIColors.warning(f"\n{antiprompt} detected. Stopping generation")
|
||||
client.generated_text = self.remove_text_from_string(client.generated_text,antiprompt)
|
||||
self.update_message(client_id, client.generated_text, parameters, metadata, None, MSG_TYPE.MSG_TYPE_FULL)
|
||||
self.update_message(client_id, client.generated_text, parameters, metadata, None, message_type)
|
||||
return False
|
||||
|
||||
self.update_message(client_id, chunk, parameters, metadata, ui=None, msg_type=message_type)
|
||||
@ -1093,6 +1093,30 @@ class LOLLMSWebUI(LOLLMSElfServer):
|
||||
self.config.end_ai_message_id_template,
|
||||
self.config.system_message_template,
|
||||
] if r!="" and r!="\n"])
|
||||
|
||||
if self.config.use_smart_routing:
|
||||
if self.config.smart_routing_router_model!="" and len(self.config.smart_routing_models_by_power)>=2:
|
||||
ASCIIColors.yellow("Using smart routing")
|
||||
self.personality.step_start("Routing request")
|
||||
self.back_model = f"{self.binding.binding_folder_name}::{self.model.model_name}"
|
||||
try:
|
||||
binding, model_name = self.model_path_to_binding_model(self.config.smart_routing_router_model)
|
||||
self.select_model(binding, model_name)
|
||||
output_id = self.personality.multichoice_question("assess the complexity of the following prompt (higher means more complex, lower less complex), if the user asking simple questions or just saying hello, please select the lowest model.", [str(i) for i in range(len(self.config.smart_routing_models_by_power))], full_prompt)
|
||||
if output_id >=0 and output_id<len(self.config.smart_routing_models_by_power):
|
||||
binding, model_name = self.model_path_to_binding_model(self.config.smart_routing_models_by_power[output_id])
|
||||
self.select_model(binding, model_name)
|
||||
self.personality.step_end("Routing request")
|
||||
self.personality.step(f"Selected {self.config.smart_routing_models_by_power[output_id]}")
|
||||
except Exception as ex:
|
||||
self.error("Failed to route beceause of this error : " + str(ex))
|
||||
self.personality.step_end("Routing request", False)
|
||||
else:
|
||||
ASCIIColors.yellow("Warning! Smart routing is active but one of the following requirements are not met")
|
||||
ASCIIColors.yellow("- smart_routing_router_model must be set correctly")
|
||||
ASCIIColors.yellow("- smart_routing_models_by_power must contain at least one model")
|
||||
|
||||
|
||||
if self.personality.processor is not None:
|
||||
ASCIIColors.info("Running workflow")
|
||||
try:
|
||||
@ -1120,6 +1144,15 @@ class LOLLMSWebUI(LOLLMSElfServer):
|
||||
|
||||
txt = self._generate(full_prompt, n_predict, client_id, callback)
|
||||
ASCIIColors.success("\nFinished executing the generation")
|
||||
|
||||
if self.config.use_smart_routing and self.config.restore_model_after_smart_routing:
|
||||
if self.config.smart_routing_router_model!="" and len(self.config.smart_routing_models_by_power)>=2:
|
||||
ASCIIColors.yellow("Restoring model")
|
||||
self.personality.step_start("Restoring main model")
|
||||
binding, model_name = self.model_path_to_binding_model(self.back_model)
|
||||
self.select_model(binding, model_name)
|
||||
self.personality.step_end("Restoring main model")
|
||||
|
||||
return txt
|
||||
|
||||
def _generate(self, prompt, n_predict, client_id, callback=None):
|
||||
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 499 B After Width: | Height: | Size: 499 B |
8
web/dist/assets/index-c5a35c15.css
vendored
8
web/dist/assets/index-dc10c3a5.css
vendored
Normal file
Before Width: | Height: | Size: 224 B After Width: | Height: | Size: 224 B |
Before Width: | Height: | Size: 363 B After Width: | Height: | Size: 363 B |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 715 B After Width: | Height: | Size: 715 B |
4
web/dist/index.html
vendored
@ -6,8 +6,8 @@
|
||||
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"></script>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>LoLLMS WebUI</title>
|
||||
<script type="module" crossorigin src="/assets/index-2e8f352a.js"></script>
|
||||
<link rel="stylesheet" href="/assets/index-c5a35c15.css">
|
||||
<script type="module" crossorigin src="/assets/index-24edfee9.js"></script>
|
||||
<link rel="stylesheet" href="/assets/index-dc10c3a5.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
@ -10,17 +10,46 @@
|
||||
>
|
||||
<button @click="addItem" class="bg-blue-500 text-white px-4 py-1 rounded hover:bg-blue-600">Add</button>
|
||||
</div>
|
||||
<ul class="list-disc list-inside">
|
||||
<li v-for="(item, index) in modelValue" :key="index" class="flex items-center mb-1">
|
||||
<ul class="list-disc list-inside" v-if="modelValue.length > 0">
|
||||
<li
|
||||
v-for="(item, index) in modelValue"
|
||||
:key="index"
|
||||
class="flex items-center mb-1 relative"
|
||||
:class="{ 'bg-gray-200': draggingIndex === index }"
|
||||
>
|
||||
<span class="flex-grow">{{ item }}</span>
|
||||
<button @click="removeItem(index)" class="text-red-500 hover:text-red-700 ml-2">
|
||||
<button
|
||||
@click="removeItem(index)"
|
||||
class="text-red-500 hover:text-red-700 ml-2"
|
||||
>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
|
||||
<path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
</button>
|
||||
<div
|
||||
v-if="draggingIndex === index"
|
||||
class="absolute top-0 left-0 w-full h-full bg-gray-200 opacity-50 cursor-move"
|
||||
@mousedown="startDragging(index)"
|
||||
@mousemove="dragItem(index)"
|
||||
@mouseup="stopDragging"
|
||||
></div>
|
||||
<div
|
||||
v-if="draggingIndex !== index && index > draggingIndex"
|
||||
class="absolute top-0 left-0 w-full h-full bg-gray-200 opacity-50 cursor-move"
|
||||
@mousedown="startDragging(index)"
|
||||
@mousemove="dragItem(index)"
|
||||
@mouseup="stopDragging"
|
||||
></div>
|
||||
<div
|
||||
v-if="draggingIndex !== index && index < draggingIndex"
|
||||
class="absolute top-0 left-0 w-full h-full bg-gray-200 opacity-50 cursor-move"
|
||||
@mousedown="startDragging(index)"
|
||||
@mousemove="dragItem(index)"
|
||||
@mouseup="stopDragging"
|
||||
></div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="mt-2">
|
||||
<div class="mt-2" v-if="modelValue.length > 0">
|
||||
<button @click="removeAll" class="bg-red-500 text-white px-4 py-1 rounded hover:bg-red-600">Remove All</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -43,6 +72,7 @@
|
||||
data() {
|
||||
return {
|
||||
newItem: '',
|
||||
draggingIndex: null,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@ -63,7 +93,23 @@
|
||||
this.$emit('update:modelValue', []);
|
||||
this.$emit('change');
|
||||
},
|
||||
startDragging(index) {
|
||||
this.draggingIndex = index;
|
||||
},
|
||||
dragItem(index) {
|
||||
if (this.draggingIndex !== null) {
|
||||
const updatedList = [...this.modelValue];
|
||||
const draggedItem = updatedList.splice(this.draggingIndex, 1)[0];
|
||||
updatedList.splice(index, 0, draggedItem);
|
||||
this.$emit('update:modelValue', updatedList);
|
||||
this.$emit('change');
|
||||
}
|
||||
},
|
||||
stopDragging() {
|
||||
this.draggingIndex = null;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@ -48,7 +48,7 @@
|
||||
>
|
||||
<i data-feather="arrow-up-circle"></i>
|
||||
<i data-feather="alert-circle"></i>
|
||||
= </button>
|
||||
</button>
|
||||
<div class="flex gap-3 items-center">
|
||||
<div v-if="settingsChanged" class="flex gap-3 items-center">
|
||||
<button v-if="!isLoading" class="text-2xl hover:text-secondary duration-75 active:scale-90"
|
||||
@ -208,20 +208,88 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- Router CONFIGS -->
|
||||
<div
|
||||
class="flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg">
|
||||
<div class="flex flex-row p-3">
|
||||
<button @click.stop="smartrouterconf_collapsed = !smartrouterconf_collapsed"
|
||||
class="text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center">
|
||||
<div v-show="smartrouterconf_collapsed" ><i data-feather='chevron-right'></i></div>
|
||||
<div v-show="!smartrouterconf_collapsed" ><i data-feather='chevron-down'></i></div>
|
||||
|
||||
<h3 class="text-lg font-semibold cursor-pointer select-none mr-2">
|
||||
Smart routing configurations</h3>
|
||||
</button>
|
||||
</div>
|
||||
<div :class="{ 'hidden': smartrouterconf_collapsed }" class="flex flex-col mb-2 px-3 pb-0">
|
||||
<div class="flex flex-col mb-2 px-3 pb-2">
|
||||
<Card title="Smart Routing Settings" :is_shrunk="false" :is_subcard="true" class="pb-2 m-2">
|
||||
<table class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500">
|
||||
<tr>
|
||||
<td style="min-width: 200px;">
|
||||
<!-- ? Label for the checkbox to enable/disable smart routing -->
|
||||
<label for="use_smart_routing" class="text-sm font-bold" style="margin-right: 1rem;">Use Smart Routing:</label>
|
||||
</td>
|
||||
<td style="width: 100%;">
|
||||
<!-- ? Checkbox input to toggle smart routing on/off -->
|
||||
<input
|
||||
type="checkbox"
|
||||
id="use_smart_routing"
|
||||
v-model="configFile.use_smart_routing"
|
||||
@change="settingsChanged=true"
|
||||
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="min-width: 200px;">
|
||||
<!-- ? Label for the input field to specify the router model -->
|
||||
<label for="smart_routing_router_model" class="text-sm font-bold" style="margin-right: 1rem;">Router Model:</label>
|
||||
</td>
|
||||
<td style="width: 100%;">
|
||||
<!-- ? Input field to enter the name of the model used for routing decisions -->
|
||||
<input
|
||||
type="text"
|
||||
id="smart_routing_router_model"
|
||||
v-model="configFile.smart_routing_router_model"
|
||||
@change="settingsChanged=true"
|
||||
class="w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="min-width: 200px;">
|
||||
<!-- ? Label for the list of models ordered by their processing power -->
|
||||
<label for="smart_routing_models_by_power" class="text-sm font-bold" style="margin-right: 1rem;">Models by Power:</label>
|
||||
</td>
|
||||
<td style="width: 100%;">
|
||||
<!-- ? Custom component to manage a list of model names, ordered by their processing capability -->
|
||||
<StringListManager
|
||||
v-model="configFile.smart_routing_models_by_power"
|
||||
@change="settingsChanged = true"
|
||||
placeholder="Enter model name"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</Card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- MAIN CONFIGS -->
|
||||
<div
|
||||
class="flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg">
|
||||
<div class="flex flex-row p-3">
|
||||
<button @click.stop="minconf_collapsed = !minconf_collapsed"
|
||||
<button @click.stop="mainconf_collapsed = !mainconf_collapsed"
|
||||
class="text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center">
|
||||
<div v-show="minconf_collapsed" ><i data-feather='chevron-right'></i></div>
|
||||
<div v-show="!minconf_collapsed" ><i data-feather='chevron-down'></i></div>
|
||||
<div v-show="mainconf_collapsed" ><i data-feather='chevron-right'></i></div>
|
||||
<div v-show="!mainconf_collapsed" ><i data-feather='chevron-down'></i></div>
|
||||
|
||||
<h3 class="text-lg font-semibold cursor-pointer select-none mr-2">
|
||||
Main configurations</h3>
|
||||
</button>
|
||||
</div>
|
||||
<div :class="{ 'hidden': minconf_collapsed }" class="flex flex-col mb-2 px-3 pb-0">
|
||||
<div :class="{ 'hidden': mainconf_collapsed }" class="flex flex-col mb-2 px-3 pb-0">
|
||||
<div class="flex flex-col mb-2 px-3 pb-2">
|
||||
<Card title="General" :is_subcard="true" class="pb-2 m-2">
|
||||
<table class="expand-to-fit bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500">
|
||||
@ -336,6 +404,24 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="min-width: 200px;">
|
||||
<label for="debug_show_final_full_prompt" class="text-sm font-bold" style="margin-right: 1rem;">Activate showing the full prompt in console (for debug):</label>
|
||||
</td>
|
||||
<td>
|
||||
<div class="flex flex-row">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="debug_show_final_full_prompt"
|
||||
required
|
||||
v-model="configFile.debug_show_final_full_prompt"
|
||||
@change="settingsChanged=true"
|
||||
class="m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600 "
|
||||
>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="min-width: 200px;">
|
||||
<label for="debug_show_final_full_prompt" class="text-sm font-bold" style="margin-right: 1rem;">Show final full prompt in console:</label>
|
||||
@ -1936,131 +2022,221 @@
|
||||
|
||||
</table>
|
||||
</Card>
|
||||
<Card title="Lollms service" :is_shrunk="true" :is_subcard="true" class="pb-2 m-2">
|
||||
|
||||
<Card title="Lollms service" :is_shrunk="true" :is_subcard="true" class="pb-2 m-2">
|
||||
<table class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500">
|
||||
<tr>
|
||||
<tr>
|
||||
<td style="min-width: 200px;">
|
||||
<label for="host" class="text-sm font-bold" style="margin-right: 1rem;">Host:</label>
|
||||
<label for="host" class="text-sm font-bold" style="margin-right: 1rem;">Host:</label>
|
||||
</td>
|
||||
<td style="width: 100%;">
|
||||
<input
|
||||
<input
|
||||
type="text"
|
||||
id="host"
|
||||
required
|
||||
v-model="configFile.host"
|
||||
@change="settingsChanged=true"
|
||||
class="w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"
|
||||
>
|
||||
class="w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="min-width: 200px;">
|
||||
<label for="lollms_access_keys" class="text-sm font-bold" style="margin-right: 1rem;">Access keys (coma separated, if empty, anyone can use the server without authentication):</label>
|
||||
<label for="lollms_access_keys" class="text-sm font-bold" style="margin-right: 1rem;">Access keys:</label>
|
||||
</td>
|
||||
<td style="width: 100%;">
|
||||
<input
|
||||
type="text"
|
||||
id="lollms_access_keys"
|
||||
required
|
||||
<StringListManager
|
||||
v-model="configFile.lollms_access_keys"
|
||||
@change="settingsChanged=true"
|
||||
class="w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"
|
||||
>
|
||||
@change="settingsChanged = true"
|
||||
placeholder="Enter access key"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="min-width: 200px;">
|
||||
<label for="discussion_db_name" class="text-sm font-bold" style="margin-right: 1rem;">Port:</label>
|
||||
<label for="port" class="text-sm font-bold" style="margin-right: 1rem;">Port:</label>
|
||||
</td>
|
||||
<td style="width: 100%;">
|
||||
<input
|
||||
<input
|
||||
type="number"
|
||||
step="1"
|
||||
id="port"
|
||||
required
|
||||
v-model="configFile.port"
|
||||
@change="settingsChanged=true"
|
||||
class="w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"
|
||||
>
|
||||
class="w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="min-width: 200px;">
|
||||
<label for="discussion_db_name" class="text-sm font-bold" style="margin-right: 1rem;">Activate headless server mode (deactivates all code exectuion to protect the PC from attacks):</label>
|
||||
<label for="headless_server_mode" class="text-sm font-bold" style="margin-right: 1rem;">Activate headless server mode:</label>
|
||||
</td>
|
||||
<td style="width: 100%;">
|
||||
<input
|
||||
<input
|
||||
type="checkbox"
|
||||
id="headless_server_mode"
|
||||
required
|
||||
v-model="configFile.headless_server_mode"
|
||||
@change="settingsChanged=true"
|
||||
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"
|
||||
>
|
||||
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="min-width: 200px;">
|
||||
<label for="activate_lollms_server" class="text-sm font-bold" style="margin-right: 1rem;">Activate lollms server:</label>
|
||||
</td>
|
||||
<td style="width: 100%;">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="activate_lollms_server"
|
||||
required
|
||||
v-model="configFile.activate_lollms_server"
|
||||
@change="settingsChanged=true"
|
||||
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"
|
||||
type="checkbox"
|
||||
id="activate_lollms_server"
|
||||
required
|
||||
v-model="configFile.activate_lollms_server"
|
||||
@change="settingsChanged=true"
|
||||
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="min-width: 200px;">
|
||||
<label for="activate_ollama_emulator" class="text-sm font-bold" style="margin-right: 1rem;">Activate ollama server emulator:</label>
|
||||
<label for="activate_lollms_rag_server" class="text-sm font-bold" style="margin-right: 1rem;">Activate lollms RAG server:</label>
|
||||
</td>
|
||||
<td style="width: 100%;">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="activate_lollms_rag_server"
|
||||
required
|
||||
v-model="configFile.activate_lollms_rag_server"
|
||||
@change="settingsChanged=true"
|
||||
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="min-width: 200px;">
|
||||
<label for="activate_lollms_tts_server" class="text-sm font-bold" style="margin-right: 1rem;">Activate lollms TTS server:</label>
|
||||
</td>
|
||||
<td style="width: 100%;">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="activate_lollms_tts_server"
|
||||
required
|
||||
v-model="configFile.activate_lollms_tts_server"
|
||||
@change="settingsChanged=true"
|
||||
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="min-width: 200px;">
|
||||
<label for="activate_lollms_stt_server" class="text-sm font-bold" style="margin-right: 1rem;">Activate lollms STT server:</label>
|
||||
</td>
|
||||
<td style="width: 100%;">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="activate_lollms_stt_server"
|
||||
required
|
||||
v-model="configFile.activate_lollms_stt_server"
|
||||
@change="settingsChanged=true"
|
||||
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="min-width: 200px;">
|
||||
<label for="activate_lollms_tti_server" class="text-sm font-bold" style="margin-right: 1rem;">Activate lollms TTI server:</label>
|
||||
</td>
|
||||
<td style="width: 100%;">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="activate_lollms_tti_server"
|
||||
required
|
||||
v-model="configFile.activate_lollms_tti_server"
|
||||
@change="settingsChanged=true"
|
||||
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="min-width: 200px;">
|
||||
<label for="activate_lollms_itt_server" class="text-sm font-bold" style="margin-right: 1rem;">Activate lollms ITT server:</label>
|
||||
</td>
|
||||
<td style="width: 100%;">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="activate_lollms_itt_server"
|
||||
required
|
||||
v-model="configFile.activate_lollms_itt_server"
|
||||
@change="settingsChanged=true"
|
||||
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="min-width: 200px;">
|
||||
<label for="activate_lollms_ttm_server" class="text-sm font-bold" style="margin-right: 1rem;">Activate lollms TTM server:</label>
|
||||
</td>
|
||||
<td style="width: 100%;">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="activate_lollms_ttm_server"
|
||||
required
|
||||
v-model="configFile.activate_lollms_ttm_server"
|
||||
@change="settingsChanged=true"
|
||||
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="min-width: 200px;">
|
||||
<label for="activate_ollama_emulator" class="text-sm font-bold" style="margin-right: 1rem;">Activate ollama server emulator:</label>
|
||||
</td>
|
||||
<td style="width: 100%;">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="activate_ollama_emulator"
|
||||
required
|
||||
v-model="configFile.activate_ollama_emulator"
|
||||
@change="settingsChanged=true"
|
||||
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"
|
||||
>
|
||||
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="min-width: 200px;">
|
||||
<label for="activate_openai_emulator" class="text-sm font-bold" style="margin-right: 1rem;">Activate openai server emulator:</label>
|
||||
<label for="activate_openai_emulator" class="text-sm font-bold" style="margin-right: 1rem;">Activate openai server emulator:</label>
|
||||
</td>
|
||||
<td style="width: 100%;">
|
||||
<input
|
||||
<input
|
||||
type="checkbox"
|
||||
id="activate_openai_emulator"
|
||||
required
|
||||
v-model="configFile.activate_openai_emulator"
|
||||
@change="settingsChanged=true"
|
||||
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"
|
||||
>
|
||||
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="min-width: 200px;">
|
||||
<label for="activate_mistralai_emulator" class="text-sm font-bold" style="margin-right: 1rem;">Activate mistral ai server emulator:</label>
|
||||
<label for="activate_mistralai_emulator" class="text-sm font-bold" style="margin-right: 1rem;">Activate mistral ai server emulator:</label>
|
||||
</td>
|
||||
<td style="width: 100%;">
|
||||
<input
|
||||
<input
|
||||
type="checkbox"
|
||||
id="activate_mistralai_emulator"
|
||||
required
|
||||
v-model="configFile.activate_mistralai_emulator"
|
||||
@change="settingsChanged=true"
|
||||
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"
|
||||
>
|
||||
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</tr>
|
||||
</table>
|
||||
</Card>
|
||||
|
||||
<Card title="STT services" :is_shrunk="true" :is_subcard="true" class="pb-2 m-2">
|
||||
<Card title="Browser Audio STT" :is_subcard="true" class="pb-2 m-2">
|
||||
<table class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500">
|
||||
@ -4100,6 +4276,7 @@ import storeLogo from '@/assets/logo.png'
|
||||
|
||||
import SVGGPU from '@/assets/gpu.svg';
|
||||
|
||||
import StringListManager from '@/components/StringListManager.vue';
|
||||
|
||||
const bUrl = import.meta.env.VITE_LOLLMS_API_BASEURL
|
||||
axios.defaults.baseURL = import.meta.env.VITE_LOLLMS_API_BASEURL
|
||||
@ -4113,6 +4290,7 @@ export default {
|
||||
BindingEntry,
|
||||
ChoiceDialog,
|
||||
Card,
|
||||
StringListManager,
|
||||
RadioOptions,
|
||||
},
|
||||
data() {
|
||||
@ -4192,7 +4370,8 @@ export default {
|
||||
data_conf_collapsed: true,
|
||||
internet_conf_collapsed: true,// internet
|
||||
servers_conf_collapsed: true, // Servers configuration
|
||||
minconf_collapsed: true, // Main configuration
|
||||
mainconf_collapsed: true, // Main configuration
|
||||
smartrouterconf_collapsed: true, // Smart router configuration
|
||||
bec_collapsed: true,
|
||||
sort_type : 0, // 0: by date, 1: by rank, 2: by name, 3: by maker, 4: by quantizer
|
||||
is_loading_zoo:false, // Is loading models zoo
|
||||
@ -4901,7 +5080,7 @@ export default {
|
||||
},
|
||||
collapseAll(val) {
|
||||
this.servers_conf_collapsed = val
|
||||
this.minconf_collapsed = val
|
||||
this.mainconf_collapsed = val
|
||||
this.bec_collapsed = val
|
||||
this.mzc_collapsed = val
|
||||
this.pzc_collapsed = val
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit dcc305c8a7a9a29ad4c27aa8ee5dd4d240d91f2c
|
||||
Subproject commit 80f7242cf96669d907333e66aab10fb929b253f6
|