Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple LLM model selection in DashBot #704

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

Mrudul111
Copy link
Contributor

@Mrudul111 Mrudul111 commented Mar 25, 2025

PR Description

The following PR adds feature to choose between Ollama, Gemini and openAI in-order to generate responses. However api-keys have not been added in the .env due to security reasons but the responses have been tested by using personal api-keys
Screenshot 2025-03-25 at 9 09 32 AM

Related Issues

#621

  • Closes #

Checklist

  • I have gone through the contributing guide
  • I have updated my branch and synced it with project main branch before making this PR
  • I am using the latest Flutter stable branch (run flutter upgrade and verify)
  • I have run the tests (flutter test) and all tests are passing

Added/updated tests?

We encourage you to add relevant test cases.

  • Yes
  • No, and this is why: because this is a normal dropdown menu

OS on which you have developed and tested the feature?

  • Windows
  • macOS
  • Linux

@ashitaprasad
Copy link
Member

What do you mean by multi-modularity?

ollama,
gemini,
openai
}
Copy link
Member

@ashitaprasad ashitaprasad Mar 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each LLMProvider should have some sort of setting where the user can click on a small settings button to change the parameters like API URL, model, etc.

DashBotService()
: _client = OllamaClient(baseUrl: 'http://127.0.0.1:11434/api') {
: _ollamaClient = OllamaClient(baseUrl: 'http://127.0.0.1:11434/api'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add provision to change baseURL via LLMProvider settings

: _client = OllamaClient(baseUrl: 'http://127.0.0.1:11434/api') {
: _ollamaClient = OllamaClient(baseUrl: 'http://127.0.0.1:11434/api'),
//TODO: Add API key to .env file
_openAiClient = OpenAIClient(apiKey: "your_openai_api_key") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add provision to add API Key via LLMProvider settings

);
return response.response.toString();
try {
switch (_selectedModel) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LLMProvider != model


case LLMProvider.ollama:
final response = await _ollamaClient.generateCompletion(
request: GenerateCompletionRequest(model: 'llama3.2:3b', prompt: prompt),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

llama3.2:3b is the model. Add provision to change it via LLMProvider settings based on list of installed models in the system

case LLMProvider.openai:
final response = await _openAiClient.createChatCompletion(
request: CreateChatCompletionRequest(
model: ChatCompletionModel.modelId('gpt-4o'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gpt-4o is the model. Add provision to change it via LLMProvider settings based on list of available openai models.

lib/main.dart Outdated
@@ -9,6 +10,8 @@ import 'app.dart';

void main() async {
WidgetsFlutterBinding.ensureInitialized();
//TODO: Add API key to .env file
Gemini.init(apiKey: "apiKey");
Copy link
Member

@ashitaprasad ashitaprasad Mar 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gemini.init cannot happen until user adds an API key via LLMProvider settings

@Mrudul111 Mrudul111 changed the title Multi-modularity in DashBot Multiple LLM model selection in DashBot Mar 26, 2025
@Mrudul111
Copy link
Contributor Author

@ashitaprasad check the new changes. Made changes in-order to select model of LLM as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants