Clone the repository:
git clone https://github.com/AI-Empower-Labs/Studio
cd ./Studio/docker/minimum
This section is key and should provide detailed instructions on how to use Docker Compose to start the system.
Notice, this example run on CPU only, so LLM inference may be slow. See GPU section on how to run with GPU if available. To start all services defined in the docker-compose.yml file:
docker compose pull
docker compose up
Start Studio UI on http://localhost:8080
To run in detached mode, use the -d flag:
docker compose logs
To follow logs for a specific service:
docker compose logs -f service_name
To stop all services:
docker compose down
AI Empowerlabs offers flexible hosting solutions for Large Language Models (LLMs) using Docker images based on ollama specifications. This document provides guidelines for local hosting and configuring GPU support when using custom models.
For additional information on custom model integration and other advanced configurations, users are encouraged to refer to the specific documentation provided by ollama or contact AI Empowerlabs support.
appsettings.json
for AI Application ConfigurationThe appsettings.json
file serves as a central configuration file for settings in an AI Empowerlabs Studio. Here are guidelines on how to create a new configuration or customize the existing settings specifically for an AI application.
appsettings.json
To customize:
"ConnectionStrings": {
"postgres": "Host=myhost;Port=5432;User Id=myuser;Database=mydb;Password=mypassword",
"libraTranslate": "http://api.example.com"
}
This section configures and manages the integration of various AI models and services. Each subsection here represents a specific AI capability or service, and adjusting these settings allows you to tailor the AI functionalities to meet specific needs.
"AiStudioOptions": {
"LicenceKey": "Your_New_License_Key_Here"
}
This subsection configures the settings for various large language models used in your application.
phi-2
, llama2-70b-4096
, mixtral-8x7b-32768
, etc.To customize: Select the model and update its attributes according to your operational requirements or credentials update.
"AiStudioOptions": {
"Llm": {
"llama3": {
"Default": "false",
"Address": "https://<dns>/v1/chat/completions",
"AuthorizationToken": "<authToken>",
"ContextSize": "32768",
"DisplayName": "llama3.1 8b",
"ModelName": "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
"EmulateFunctionCalling": true,
"Tokenizer": "llama"
}
}
}
The Tokenizer value in the configuration can be set to one of the following supported tokenizer types, depending on the specific model or service you intend to use:
XlmRobertaBase
llama
mistral
mxbai-embed-large-v1
gpt-4o
gpt-4
gpt-3.5-turbo
gpt-3.5-turbo-16k
gpt-35
gpt-35-turbo
gpt-35-turbo-16k
text-davinci-003
text-davinci-002
text-davinci-001
text-curie-001
text-babbage-001
text-ada-001
davinci
curie
babbage
ada
code-davinci-002
code-davinci-001
code-cushman-002
code-cushman-001
davinci-codex
cushman-codex
text-davinci-edit-001
code-davinci-edit-001
text-embedding-ada-002
text-embedding-3-small
text-embedding-3-large
text-similarity-davinci-001
text-similarity-curie-001
text-similarity-babbage-001
text-similarity-ada-001
text-search-davinci-doc-001
text-search-curie-doc-001
text-search-babbage-doc-001
text-search-ada-doc-001
code-search-babbage-code-001
code-search-ada-code-001
gpt2
Manages the embedding models for transforming text into numerical vectors, which are useful in various machine learning and AI tasks.
multilingual-e5-large
, mxbai-embed-large-v1
, etc.To customize:
Modify properties such as MaxTokens
or Dimensions
to tune the model's performance according to your requirements.
"AiStudioOptions": {
"Embedding": {
"multilingual-e5-large": {
"Default": true,
"Address": "http://127.0.0.1:3000",
"MaxTokens": "512",
"Dimensions": "1024",
"DisplayName": "multilingual-e5-large",
"Tokenizer": "XlmRobertaBase"
}
}
}
Configures transcription services that convert speech to text.
To customize:
Update the Address
to point to a new transcription service if changed.
"AiStudioOptions": {
"Transcription": {
"AiEmpowerLabs": {
"Default": "true",
"Address": "http://new_transcription_service.example.com"
}
}
}
The SemanticSearchLogDbRetentionTime property configures the retention period for the Semantic Search query logs. This setting determines how long the query logs are stored before being automatically deleted.
Type: Duration, optional Accepted Values: A duration of time, such as 10 days, 10.00:00:00, or 365 days. If not specified, the system will not remove logs.
"AiStudioOptions": {
"SemanticSearchLogDbRetentionTime": "31 days"
}
After editing the appsettings.json
with the new configurations, save the file and ensure to restart your ASP.NET application to apply the changes. It's crucial to validate the settings for correctness to prevent any disruptions in the functionality of your application.
appsettings.json
for AI Application ConfigurationThe KernelMemory
section of the appsettings.json
file is essential for defining and managing the data processing, ingestion, retrieval, and storage strategies of your AI application. This section controls how data is handled throughout its lifecycle in the application, from initial ingestion to retrieval for AI processes.
KernelMemory
The KernelMemory
subsections allow for detailed control over various stages of data management. Here’s how you can tailor each to better fit the operational needs of your AI systems.
To customize:
DefaultSteps: Modify this array to include or exclude steps such as 'extract', 'sanitize', etc., depending on your data processing requirements.
TextPartitioning: Adjust settings like MaxTokensPerParagraph
, MaxTokensPerLine
, and OverlappingTokens
to optimize how text data is broken down.
"KernelMemory": {
"DataIngestion": {
"DefaultSteps": ["extract", "sanitize", "transform", "save_records"],
"TextPartitioning": {
"MaxTokensPerParagraph": 1000,
"MaxTokensPerLine": 250,
"OverlappingTokens": 100
}
}
}
To customize:
"KernelMemory": {
"Retrieval": {
"SearchClient": {
"MaxAskPromptSize": 5000,
"MaxMatchesCount": 50,
"AnswerTokens": 400,
"EmptyAnswer": "No relevant information available."
}
}
}
To customize:
"KernelMemory": {
"Services": {
"Postgres": {
"TableNamePrefix": "ai_memory_",
"Columns": {
"id": "pk",
"embedding": "vector(2048)",
"tags": "labels",
"content": "chunk",
"payload": "extras"
},
"CreateTableSql": [
"BEGIN;",
"CREATE TABLE IF NOT EXISTS %%table_name%% (",
" pk TEXT NOT NULL PRIMARY KEY,",
" embedding vector(2048),",
" labels TEXT[] DEFAULT '{}'::TEXT[] NOT NULL,",
" chunk TEXT DEFAULT '' NOT NULL,",
" extras JSONB DEFAULT '{}'::JSONB NOT NULL,",
" my_field1 TEXT DEFAULT '',",
"_update TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP",
");",
"CREATE INDEX ON %%table_name%% USING GIN(labels);",
"CREATE INDEX ON %%table_name%% USING hnsw (embedding vector_cosine_ops);",
"COMMIT;"
]
}
}
}
Configures logging via Serilog.
To customize:
"Serilog": {
"MinimumLevel": {
"Default": "Warning"
},
"WriteTo": [
{
"Name": "Console",
"Args": {
"restrictedToMinimumLevel": "Error"
}
}
]
}
After making changes to the appsettings.json
, save the file and restart your ASP.NET application to apply these adjustments. It is essential to validate the settings to prevent configuration errors that could disrupt the operation of your application.