#1. Purpose
#2. Core Concept
#3. Features snapshot
#5. Q&A
#6. Citation
source code
Shiny LLM map is designed to provide a user-friendly interface for playing with multiple large language models easily, the core features are MAP. This is the web demo
- Multi ASK, Ask text question & chat with multiple models , - Analyze IMG, Vision picture topic and contents - Probe DB, Evaluate a database value, query data with nature language |
The core concept of Shiny llm map app is value driven which including -
-
Multi connection, instead of connect to one model, user ask one or more models work for task via drop down list. Openrouter API service was choice as base connector service. It is not free, but a api connectors to provide the best models & prices for your prompts service.
-
More reproducible, instead of get random geneated answers, using predefine parameter to let model answer reproducible.(still testing)
-
Less dependence, instead of using various models api library and agent library like lang chain, it is developed based on R an CRAN. (shiny, httr2, purrr, tidyverse, jsonlite, box and others r packages used)
Ask one question, all the selected models will response the answer based on their model understanding. You may open eyes to check how different or how exact same of those answer.
image + model + your question + click = analyze picture answer.
The probe DB feature is targeted to help people use large language mode to evaluation value, catalog list , query their data.
by combined the database schema and statistic information
To use the shiny llm map , you has two choices:
just open below link for fun, web demo
if you are familiar with Rstudio, clone it as your new project and have fun.
step | note |
---|---|
1. clone new project from github ) |
the github url is : shiny_llm_map |
2 Get OpenAPI key | - link: https://openrouter.ai/keys - There are free models but popular model charged per usage. |
3. fill .Renviron file with key ) |
write the api key in to .Renviron under project root folder |
4. Run it |
Launch it by open app.R and click Run button |
5. Play it |
Enjoy it and have fun! |
If the source code has been download to local computer, and open the project at Rstudio. You can call some function directly
- step 1, open the llmapi.R under etl folder, and click the source to load the script. Note: directly source('../etl/llmapi.R') will report Error, it has be to sourced by Rstudio file menu.
source('./etl/llmapi.R')
llm_result <- get_llm_result(prompt='hello ai world! which orgination create you?', model_id='gpt35',llm_type='chat')
ai_result <- get_ai_result(llm_result,ai_type='chat')
print(ai_result)
# $role
# [1] "assistant"
# $content
# [1] "Hello! I am glad to assist you. I was created by a team of programmers and developers at OpenAI. If you have any questions or need help with anything, feel free to ask!"
If you use this code for your research or project, please cite it as follows:
OpenRouter[2024]. Quick Start. Retrieved from [https://openrouter.ai/docs/quick-start].
Google[2024]. https://github.com/google-gemini/cookbook. Retrieved from [https://github.com/google-gemini/cookbook].
OpenAI[2024]. openai-cookbook. Retrieved from [https://github.com/openai/openai-cookbook].
Hadley Wickham (2023). httr2. GitHub Repository. Retrieved from [https://github.com/r-lib/httr2/].
Hadley Wickham (2023). Functional Programming Tools • purrr. GitHub Repository. Retrieved from [https://github.com/tidyverse/purrr/].
Jinhwan Kim (2023). Use google’s Gemini in R with R package “gemini.R”. GitHub Repository. Retrieved from [https://github.com/jhk0530/gemini.R].