Skip to content

Commit 691b51f

Browse files
authored
ROB-1032 llm selection (#1786)
support llm model selection in holmes
1 parent 93919eb commit 691b51f

4 files changed

Lines changed: 51 additions & 5 deletions

File tree

docs/configuration/holmesgpt/index.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,46 @@ Choose an AI provider below and follow the instructions:
223223
224224
Run a :ref:`Helm Upgrade <Simple Upgrade>` to apply the configuration.
225225

226+
.. tab-item:: Multiple providers
227+
:name: multiple-providers
228+
229+
Starting from version *0.22.1*, Robusta supports an alternative way to configure AI models: using a YAML dictionary in your Helm values file.
230+
231+
This method allows you to configure multiple models at once, each with its own parameters.
232+
233+
Update your Helm values (``generated_values.yaml`` file) with the following configuration.
234+
235+
When multiple models are defined, the Robusta UI will allow users to choose a specific model when initiating an AI-based investigation.
236+
237+
.. admonition:: Model info
238+
:class: warning
239+
240+
When using multiple providers, the keys differ slightly from the single-provider case.
241+
242+
.. code-block:: yaml
243+
244+
enableHolmesGPT: true
245+
246+
holmes:
247+
modelList: # sample configuration.
248+
openai:
249+
model: openai/gpt-4o
250+
api_key: "{{ env.API_KEY }}"
251+
azure-low-budget:
252+
model : azure/team-low-budget
253+
api_base : <your-api-base> # fill in the base endpoint url of your azure deployment - e.g. https://my-org.openai.azure.com/
254+
api_version : "2024-06-01"
255+
api_key : "{{ env.AZURE_API_KEY }}" # you can load the values from an environment variable as well.
256+
temperature: 0
257+
bedrock-devops:
258+
model: bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0 # your bedrock model.
259+
aws_region_name: us-east-1
260+
aws_access_key_id: "{{ env.AWS_ACCESS_KEY_ID }}" # you can load the values from an environment variable as well.
261+
aws_secret_access_key: <your-aws-secret-access-key>
262+
thinking: {"type": "enabled", "budget_tokens": 1024}
263+
264+
Run a :ref:`Helm Upgrade <Simple Upgrade>` to apply the configuration.
265+
226266
Configuring HolmesGPT Access to SaaS Data
227267
----------------------------------------------------
228268

src/robusta/core/model/base_params.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class ResourceInfo(BaseModel):
8383
class HolmesParams(ActionParams):
8484

8585
holmes_url: Optional[str]
86-
86+
model: Optional[str]
8787
@validator("holmes_url", allow_reuse=True)
8888
def validate_protocol(cls, v):
8989
if v and not v.startswith("http"): # if the user configured url without http(s)
@@ -251,6 +251,7 @@ class HolmesWorkloadHealthChatParams(HolmesParams):
251251
conversation_history: Optional[list[dict]] = None
252252

253253

254+
254255
class NamespacedResourcesParams(ActionParams):
255256
"""
256257
:var name: Resource name

src/robusta/core/playbooks/internal/ai_integration.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ def ask_holmes(event: ExecutionBaseEvent, params: AIInvestigateParams):
6060
context=params.context if params.context else {},
6161
include_tool_calls=True,
6262
include_tool_call_results=True,
63-
sections=params.sections
63+
sections=params.sections,
64+
model=params.model
6465
)
6566

6667
if params.stream:
@@ -287,6 +288,7 @@ def holmes_issue_chat(event: ExecutionBaseEvent, params: HolmesIssueChatParams):
287288
conversation_history=params.conversation_history,
288289
investigation_result=params.context.investigation_result,
289290
issue_type=params.context.issue_type,
291+
model=params.model
290292
)
291293
result = requests.post(f"{holmes_url}/api/issue_chat", data=holmes_req.json())
292294
result.raise_for_status()
@@ -336,7 +338,7 @@ def holmes_chat(event: ExecutionBaseEvent, params: HolmesChatParams):
336338
cluster_name = event.get_context().cluster_name
337339

338340
try:
339-
holmes_req = HolmesChatRequest(ask=params.ask, conversation_history=params.conversation_history)
341+
holmes_req = HolmesChatRequest(ask=params.ask, conversation_history=params.conversation_history, model=params.model)
340342
result = requests.post(f"{holmes_url}/api/chat", data=holmes_req.json())
341343
result.raise_for_status()
342344
holmes_result = HolmesChatResult(**json.loads(result.text))
@@ -380,11 +382,12 @@ def holmes_workload_chat(event: ExecutionBaseEvent, params: HolmesWorkloadHealth
380382
ask=params.ask,
381383
conversation_history=params.conversation_history,
382384
workload_health_result=params.workload_health_result,
383-
resource=params.resource
385+
resource=params.resource,
386+
model=params.model
384387
)
385388
result = requests.post(f"{holmes_url}/api/workload_health_chat", data=holmes_req.json())
386389
result.raise_for_status()
387-
390+
388391
holmes_result = HolmesChatResult(**json.loads(result.text))
389392

390393
finding = Finding(

src/robusta/core/reporting/holmes.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class HolmesRequest(BaseModel):
2020
include_tool_calls: bool = False
2121
include_tool_call_results: bool = False
2222
sections: Optional[Dict[str, str]] = None
23+
model: Optional[str] = None
2324

2425

2526
class HolmesConversationRequest(BaseModel):
@@ -35,6 +36,7 @@ class HolmesConversationRequest(BaseModel):
3536
class HolmesChatRequest(BaseModel):
3637
ask: str
3738
conversation_history: Optional[List[dict]] = None
39+
model: Optional[str] = None
3840

3941

4042
class HolmesIssueChatRequest(HolmesChatRequest):

0 commit comments

Comments
 (0)