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

Models superagi #936

Merged
merged 76 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
46ae580
adding llama2 changes using replicate
Jul 19, 2023
4dbe326
Adding misssing llm file
Jul 19, 2023
18da502
Update llm_model_factory.py
Jul 20, 2023
fd48dc7
Update token_counter.py
Jul 20, 2023
83a5dc1
adding replicate token in the config_example
Jul 21, 2023
c3b2a36
Update replicate.py
Jul 25, 2023
1ccd2cd
First Commit for Models
jedan2506 Aug 1, 2023
642b4b7
Second Commit for Models
jedan2506 Aug 1, 2023
43ecd31
Third Commit for Models
jedan2506 Aug 1, 2023
09f9cc7
Updated
jedan2506 Aug 1, 2023
5d75e13
Replicate Branch Merged
jedan2506 Aug 2, 2023
445c497
Updates
jedan2506 Aug 2, 2023
3da3d30
Merge branch 'dev' of github.com:TransformerOptimus/SuperAGI into mod…
jedan2506 Aug 2, 2023
f71338a
Updates
jedan2506 Aug 2, 2023
14edd62
Updates
jedan2506 Aug 2, 2023
f691411
Updates
jedan2506 Aug 3, 2023
3bbdc31
updates
jedan2506 Aug 3, 2023
f95f656
updates
jedan2506 Aug 3, 2023
d5f9411
updates
jedan2506 Aug 3, 2023
fadf8b1
Updates
jedan2506 Aug 4, 2023
57c3853
Updates
jedan2506 Aug 4, 2023
40f2d76
Updates
jedan2506 Aug 4, 2023
c8d42a7
Updates
jedan2506 Aug 4, 2023
91136ad
Updates
jedan2506 Aug 7, 2023
fcbfd17
Updates
jedan2506 Aug 7, 2023
8ff83b0
Updates
jedan2506 Aug 7, 2023
78ff836
Updates
jedan2506 Aug 7, 2023
fa4b38c
Updates
jedan2506 Aug 7, 2023
43bdd44
Updates
jedan2506 Aug 7, 2023
8bd95e6
Updates
jedan2506 Aug 7, 2023
ad9bc21
Updates
jedan2506 Aug 8, 2023
f5f2998
Updates
jedan2506 Aug 8, 2023
854e88c
Updates
jedan2506 Aug 9, 2023
52cb4aa
Updates
jedan2506 Aug 9, 2023
ec7c271
Updates
jedan2506 Aug 9, 2023
94d5977
Bug Fixes
jedan2506 Aug 10, 2023
f314325
Updates
jedan2506 Aug 10, 2023
955d648
Updates
jedan2506 Aug 10, 2023
adcf3a5
Updates
jedan2506 Aug 11, 2023
775fad7
Updates
jedan2506 Aug 13, 2023
ba7c9c6
Updates
jedan2506 Aug 16, 2023
9dbe3a3
Updates
jedan2506 Aug 16, 2023
27a2147
Updates
jedan2506 Aug 16, 2023
21e601b
Updates
jedan2506 Aug 17, 2023
02475a7
Updates
jedan2506 Aug 17, 2023
ab7ffe2
Updates
jedan2506 Aug 17, 2023
b712620
Updates
jedan2506 Aug 17, 2023
2601682
Updates
jedan2506 Aug 17, 2023
22e5c32
Updates
jedan2506 Aug 18, 2023
b9bafb0
Updates
jedan2506 Aug 18, 2023
5fc3c42
Updates
jedan2506 Aug 18, 2023
e01ccfe
Updates
jedan2506 Aug 18, 2023
3805f99
Updates
jedan2506 Aug 18, 2023
6729c11
Updates
jedan2506 Aug 18, 2023
3ac9ffa
Updates
jedan2506 Aug 18, 2023
0ec2709
Updates
jedan2506 Aug 18, 2023
12e904e
Updates
jedan2506 Aug 21, 2023
6e4efdd
Updates
jedan2506 Aug 21, 2023
3884f0a
Updates
jedan2506 Aug 21, 2023
87160ac
Updates
jedan2506 Aug 21, 2023
5ce47ce
Updates
jedan2506 Aug 21, 2023
05b14d9
Updates
jedan2506 Aug 22, 2023
edb27cd
Updates
jedan2506 Aug 22, 2023
db17d1b
Updates
jedan2506 Aug 22, 2023
4ff94f9
Updates
jedan2506 Aug 22, 2023
c0d3f44
Updates
jedan2506 Aug 22, 2023
9593ce9
Updates
jedan2506 Aug 22, 2023
91fd6a8
Updates
jedan2506 Aug 22, 2023
de30cb9
Updates
jedan2506 Aug 23, 2023
16671b0
Updates
jedan2506 Aug 23, 2023
83f37d1
Updates
jedan2506 Aug 23, 2023
c100b21
Updates
jedan2506 Aug 23, 2023
619c2fa
Updates
jedan2506 Aug 23, 2023
bdb7f85
Updates
jedan2506 Aug 23, 2023
fe63ddc
Updates
jedan2506 Aug 23, 2023
560870e
Updates
jedan2506 Aug 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions config_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ PINECONE_ENVIRONMENT: YOUR_PINECONE_ENVIRONMENT

OPENAI_API_KEY: YOUR_OPEN_API_KEY
PALM_API_KEY: YOUR_PALM_API_KEY
REPLICATE_API_TOKEN: YOUR_REPLICATE_API_TOKEN
HUGGING_API_TOKEN: YOUR_HUGGING_FACE_API_TOKEN

# For locally hosted LLMs comment out the next line and uncomment the one after
# to configure a local llm point your browser to 127.0.0.1:7860 and click on the model tab in text generation web ui.
Expand Down
2 changes: 1 addition & 1 deletion gui/pages/Content/APM/ApmDashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default function ApmDashboard() {
const fetchData = async () => {
try {
const [metricsResponse, agentsResponse, activeRunsResponse, toolsUsageResponse] = await Promise.all([getMetrics(), getAllAgents(), getActiveRuns(), getToolsUsage()]);
const models = ['gpt-4', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-4-32k', 'google-palm-bison-001'];
const models = ['gpt-4', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-4-32k', 'google-palm-bison-001', 'replicate-llama13b-v2-chat'];

assignDefaultDataPerModel(metricsResponse.data.agent_details.model_metrics, models);
assignDefaultDataPerModel(metricsResponse.data.tokens_details.model_metrics, models);
Expand Down
45 changes: 31 additions & 14 deletions gui/pages/Content/Agents/AgentCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
getLlmModels,
updateExecution,
uploadFile,
getAgentDetails, addAgentRun,
getAgentDetails, addAgentRun, fetchModels,
getAgentWorkflows
} from "@/pages/api/DashboardService";
import {
Expand Down Expand Up @@ -56,6 +56,7 @@ export default function AgentCreate({
const [searchValue, setSearchValue] = useState('');
const [showButton, setShowButton] = useState(false);
const [showPlaceholder, setShowPlaceholder] = useState(true);
const [modelsArray, setModelsArray] = useState([]);

const constraintsArray = [
"If you are unsure how you previously did something or want to recall past events, thinking about similar events will help you remember.",
Expand All @@ -68,8 +69,8 @@ export default function AgentCreate({
const [goals, setGoals] = useState(['Describe the agent goals here']);
const [instructions, setInstructions] = useState(['']);

const [modelsArray, setModelsArray] = useState([]);
const [model, setModel] = useState('');
const models = ['gpt-4', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-4-32k', 'google-palm-bison-001', 'replicate-llama13b-v2-chat']
const [model, setModel] = useState(models[1]);
const modelRef = useRef(null);
const [modelDropdown, setModelDropdown] = useState(false);

Expand Down Expand Up @@ -150,16 +151,17 @@ export default function AgentCreate({
}, [toolNames]);

useEffect(() => {
getLlmModels()
fetchModels()
.then((response) => {
const models = response.data || [];
const models = response.data.map(model => model.name) || [];
const selected_model = localStorage.getItem("agent_model_" + String(internalId)) || '';
setModelsArray(models);
if (models.length > 0 && !selected_model) {
setLocalStorageValue("agent_model_" + String(internalId), models[0], setModel);
} else {
setModel(selected_model);
}
console.log(response)
})
.catch((error) => {
console.error('Error fetching models:', error);
Expand Down Expand Up @@ -350,8 +352,8 @@ export default function AgentCreate({

const handleModelSelect = (index) => {
setLocalStorageValue("agent_model_" + String(internalId), modelsArray[index], setModel);
if (modelsArray[index] === "google-palm-bison-001") {
setAgentWorkflow("Fixed Task Queue")
if (modelsArray[index] === "google-palm-bison-001" || modelsArray[index] === "replicate-llama13b-v2-chat") {
setAgentType("Fixed Task Queue")
}
setModelDropdown(false);
};
Expand Down Expand Up @@ -941,13 +943,28 @@ export default function AgentCreate({
alt="expand-icon"/>
</div>
<div>
{modelDropdown && <div className="custom_select_options" ref={modelRef} style={{width: '100%'}}>
{modelsArray?.map((model, index) => (
<div key={index} className="custom_select_option" onClick={() => handleModelSelect(index)}
style={{padding: '12px 14px', maxWidth: '100%'}}>
{model}
</div>))}
</div>}
{modelDropdown && (
<div className="custom_select_options" ref={modelRef} style={{width: '100%', maxHeight: '300px'}}>
<div className="model_options">
{modelsArray?.map((model, index) => (
<div key={index} className="custom_select_option" onClick={() => handleModelSelect(index)}
style={{padding: '12px 14px', maxWidth: '100%'}}>
{model}
</div>
))}
</div>
<div className="vertical_containers sticky_option">
<div onClick={() => openNewTab(-4, "Marketplace", "Marketplace", false)} className="custom_select_option horizontal_container mxw_100 padding_12_14 gap_6 bt_white">
<Image width={16} height={16} src="/images/marketplace_logo.png" alt="marketplace_logo" />
<span>Browse models from marketplace</span>
</div>
<div onClick={() => openNewTab(-5, "new model", "Add_Model", false)} className="custom_select_option horizontal_container mxw_100 padding_12_14 gap_6 bt_white">
<Image width={16} height={16} src="/images/plus.png" alt="plus_image" />
<span>Add new custom model</span>
</div>
</div>
</div>
)}
</div>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions gui/pages/Content/Agents/AgentTemplatesList.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,17 @@ export default function AgentTemplatesList({
</div>
<div className={styles.rowContainer}
style={{maxHeight: '78vh', overflowY: 'auto', marginTop: '10px', marginLeft: '3px'}}>
{agentTemplates.length > 0 ? <div className={styles.resources}>
{agentTemplates.length > 0 ? <div className="marketplaceGrid3">
{agentTemplates.map((item) => (
<div className={styles.market_tool} key={item.id} style={{cursor: 'pointer', height: '85px'}}
<div className="market_containers cursor_pointer" key={item.id} style={{cursor: 'pointer', height: '85px'}}
onClick={() => handleTemplateClick(item)}>
<div style={{display: 'inline', overflow: 'auto'}}>
<div>{item.name}</div>
<div className={styles.tool_description}>{item.description}</div>
</div>
</div>
))}
<div className={styles.market_tool} style={{cursor: 'pointer', height: '85px', background: '#413C4F'}}
<div className="market_containers cursor_pointer" style={{cursor: 'pointer', height: '85px', background: '#413C4F'}}
onClick={openMarketplace}>
<div style={{display: 'inline', overflow: 'auto'}}>
<div style={{display: 'flex', justifyContent: 'space-between', gap: '0.3vw'}}>
Expand Down
50 changes: 20 additions & 30 deletions gui/pages/Content/Marketplace/Market.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import styles from './Market.module.css';
import MarketKnowledge from './MarketKnowledge';
import MarketAgent from './MarketAgent';
import MarketTools from './MarketTools';
import MarketModels from '../Models/MarketModels';
import ToolkitTemplate from './ToolkitTemplate';
import ModelTemplate from "../Models/ModelTemplate";
import {EventBus} from "@/utils/eventBus";
import AgentTemplate from "./AgentTemplate";
import KnowledgeTemplate from "./KnowledgeTemplate";
Expand Down Expand Up @@ -64,48 +66,36 @@ export default function Market({env}) {
<div style={{width: '100%', display: 'flex', flexDirection: 'column'}}>
<div className={styles.detail_top}>
<div style={{display: 'flex', overflowX: 'scroll', marginLeft: '8px'}}>
<div>
<button onClick={() => switchTab('market_tools')} className={styles.tab_button}
style={activeTab === 'market_tools' ? {
background: '#454254',
paddingRight: '15px'
} : {background: 'transparent', paddingRight: '15px'}}>
<Image style={{marginTop: '-1px'}} width={14} height={14} src="/images/tools_light.svg"
alt="tools-icon"/>&nbsp;Tools
</button>
</div>
<div>
<button onClick={() => switchTab('market_knowledge')} className={styles.tab_button}
style={activeTab === 'market_knowledge' ? {
background: '#454254',
paddingRight: '15px'
} : {background: 'transparent', paddingRight: '15px'}}>
<Image style={{marginTop: '-1px'}} width={14} height={14} src="/images/knowledge.svg"
alt="knowledge-icon"/>&nbsp;Knowledge
</button>
</div>
<div>
<button onClick={() => switchTab('market_agents')} className={styles.tab_button}
style={activeTab === 'market_agents' ? {
background: '#454254',
paddingRight: '15px'
} : {background: 'transparent', paddingRight: '15px'}}>
<Image style={{marginTop: '-1px'}} width={14} height={14} src="/images/agents_light.svg"
alt="agent-template-icon"/>&nbsp;Agent Templates
</button>
</div>
<button onClick={() => switchTab('market_tools')} className={activeTab === 'market_tools' ? 'tab_button_selected' : 'tab_button'}>
<Image width={14} height={14} src="/images/tools_light.svg" alt="tools-icon"/>
<span>Tools</span>
</button>
<button onClick={() => switchTab('market_knowledge')} className={activeTab === 'market_knowledge' ? 'tab_button_selected' : 'tab_button'}>
<Image width={14} height={14} src="/images/knowledge.svg" alt="knowledge-icon"/>
<span>Knowledge</span>
</button>
<button onClick={() => switchTab('market_agents')} className={activeTab === 'market_agents' ? 'tab_button_selected' : 'tab_button'}>
<Image width={14} height={14} src="/images/agents_light.svg" alt="agent-template-icon"/>
<span>Agent Templates</span>
</button>
<button onClick={() => switchTab('market_models')} className={activeTab === 'market_models' ? 'tab_button_selected' : 'tab_button'}>
<Image width={14} height={14} src="/images/models.svg" alt="model-template-icon"/>
<span>Models</span>
</button>
</div>
</div>
<div>
{activeTab === 'market_tools' && <MarketTools/>}
{activeTab === 'market_knowledge' && <MarketKnowledge/>}
{activeTab === 'market_agents' && <MarketAgent/>}
{activeTab === 'market_models' && <MarketModels/>}
</div>
</div>
</div> : <div style={{padding: '0 3px'}}>
{detailType === 'agent_template' && <AgentTemplate env={env} template={templateData}/>}
{detailType === 'knowledge_template' && <KnowledgeTemplate env={env} template={templateData}/>}
{detailType === 'tool_template' && <ToolkitTemplate env={env} template={templateData}/>}
{detailType === 'model_template' && <ModelTemplate env={env} template={templateData} />}
</div>}
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion gui/pages/Content/Marketplace/Market.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@
display: flex;
justify-content: flex-start;
flex-wrap: wrap;
gap: 0.3vw;
gap: 6px;
}

.agent_resources {
Expand Down
5 changes: 2 additions & 3 deletions gui/pages/Content/Marketplace/MarketAgent.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, {useEffect, useState} from "react";
import Image from "next/image";
import styles from './Market.module.css';
import {fetchAgentTemplateList} from "@/pages/api/DashboardService";
import {EventBus} from "@/utils/eventBus";
import {loadingTextEffect} from "@/utils/utils";
Expand Down Expand Up @@ -48,8 +47,8 @@ export default function MarketAgent() {
<div className={showMarketplace ? 'ml_8' : 'ml_3'}>
<div className="w_100 overflowY_auto mxh_78vh">
{!isLoading ? <div>
{agentTemplates.length > 0 ? <div className={styles.resources}>{agentTemplates.map((item, index) => (
<div className="market_tool cursor_pointer" key={item.id} onClick={() => handleTemplateClick(item)}>
{agentTemplates.length > 0 ? <div className="marketplaceGrid3">{agentTemplates.map((item, index) => (
<div className="market_containers cursor_pointer" key={item.id} onClick={() => handleTemplateClick(item)}>
<div className="vertical_containers overflow_auto">
<div>{item.name}</div>
<div className="color_gray lh_16">by SuperAgi&nbsp;<Image width={14} height={14}
Expand Down
4 changes: 2 additions & 2 deletions gui/pages/Content/Marketplace/MarketKnowledge.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ export default function MarketKnowledge() {
<div className={showMarketplace ? 'ml_8' : 'ml_3'}>
<div className="w_100 overflowY_auto mxh_78vh">
{!isLoading ? <div>
{knowledgeTemplates.length > 0 ? <div className={styles.resources}>{knowledgeTemplates.map((item, index) => (
<div className={styles.market_tool} key={item.id} style={{cursor: 'pointer', display: 'block'}}
{knowledgeTemplates.length > 0 ? <div className="marketplaceGrid3">{knowledgeTemplates.map((item, index) => (
<div className="market_containers cursor_pointer" key={item.id} style={{cursor: 'pointer', display: 'block'}}
onClick={() => handleTemplateClick(item)}>
<div style={{display: 'inline', overflow: 'auto'}}>
<div className="horizontal_space_between">
Expand Down
5 changes: 2 additions & 3 deletions gui/pages/Content/Marketplace/MarketTools.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, {useEffect, useState} from "react";
import Image from "next/image";
import styles from './Market.module.css';
import {fetchToolTemplateList} from "@/pages/api/DashboardService";
import {EventBus} from "@/utils/eventBus";
import {loadingTextEffect, excludedToolkits, returnToolkitIcon} from "@/utils/utils";
Expand Down Expand Up @@ -50,8 +49,8 @@ export default function MarketTools() {
<div className={showMarketplace ? 'ml_8' : 'ml_3'}>
<div className="w_100 overflowY_auto mxh_78vh">
{!isLoading ? <div>
{toolTemplates.length > 0 ? <div className={styles.resources}>{toolTemplates.map((item) => (
<div className="market_tool cursor_pointer" key={item.id} onClick={() => handleTemplateClick(item)}>
{toolTemplates.length > 0 ? <div className="marketplaceGrid3">{toolTemplates.map((item) => (
<div className="market_containers cursor_pointer" key={item.id} onClick={() => handleTemplateClick(item)}>
<div className="horizontal_container overflow_auto">
<Image className="tool_icon" width={40} height={40} src={returnToolkitIcon(item.name)} alt="tool-icon"/>
<div className="ml_12 mb_8">
Expand Down
16 changes: 16 additions & 0 deletions gui/pages/Content/Models/AddModel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React, {useEffect, useState} from "react";
import ModelForm from "./ModelForm";

export default function AddModel(internalId){
return(
<div id="add_model">
<div className="row">
<div className="col-3" />
<div className="col-6 col-6-scrollable">
<ModelForm internalId={internalId}/>
</div>
<div className="col-3" />
</div>
</div>
)
}
Loading