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

[WIP] Ollama support #81

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions cofounder/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@google-cloud/storage": "^7.12.1",
"@resvg/resvg-js": "^2.6.2",
"async-retry": "^1.3.3",
"axios": "^1.7.7",
"colormap": "^2.3.2",
"cors": "^2.8.5",
"deepmerge": "^4.3.1",
Expand Down
2 changes: 1 addition & 1 deletion cofounder/api/system/functions/backend/asyncapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ you're a genius`,
},
},
data: {
model: `chatgpt-4o-latest`, //`gpt-4o`,
model: process.env.LOCAL_INFERENCE_MODEL, //`gpt-4o`,
messages,
preparser: `backticks`,
parser: `yaml`,
Expand Down
4 changes: 2 additions & 2 deletions cofounder/api/system/functions/backend/openapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ ${prd}
},
{
role: "user",
content: `\`\`\`PRD:product-requirements-document
content: `\`\`\`FRD:features-requirements-document
${frd}
\`\`\``,
},
Expand Down Expand Up @@ -147,7 +147,7 @@ you're a genius`,
},
},
data: {
model: `chatgpt-4o-latest`, //`gpt-4o`,
model: process.env.LOCAL_INFERENCE_MODEL, //`gpt-4o`,
messages,
preparser: `backticks`,
parser: `yaml`,
Expand Down
2 changes: 1 addition & 1 deletion cofounder/api/system/functions/backend/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ now do the analysis , write the full working script and specify the dependencies
},
},
data: {
model: `chatgpt-4o-latest`, //`gpt-4o`,
model: process.env.LOCAL_INFERENCE_MODEL, //`gpt-4o`,
messages: messages,
preparser: false,
parser: false,
Expand Down
2 changes: 1 addition & 1 deletion cofounder/api/system/functions/db/postgres.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ you're a genius`
},
},
data: {
model: `chatgpt-4o-latest`,//`gpt-4o`,
model: process.env.LOCAL_INFERENCE_MODEL,//`gpt-4o`,
messages,
preparser: `backticks`,
parser: false,
Expand Down
2 changes: 1 addition & 1 deletion cofounder/api/system/functions/db/schemas.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ you're a genius`
},
},
data: {
model: `chatgpt-4o-latest`,//`gpt-4o`,
model: process.env.LOCAL_INFERENCE_MODEL,//`gpt-4o`,
messages,
preparser: `backticks`,
parser: `yaml`,
Expand Down
6 changes: 3 additions & 3 deletions cofounder/api/system/functions/designer/layoutv1.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ async function designerLayoutv1ViewGenerate({ context, data }) {
},
},
data: {
model: `chatgpt-4o-latest`, //`gpt-4o`,
model: process.env.LOCAL_INFERENCE_MODEL, //`gpt-4o`,
messages: analysisPassMessages,
preparser: `backticks`,
parser: false,
Expand All @@ -487,7 +487,7 @@ async function designerLayoutv1ViewGenerate({ context, data }) {
},
},
data: {
model: `chatgpt-4o-latest`, //`gpt-4o`,
model: process.env.LOCAL_INFERENCE_MODEL, //`gpt-4o`,
messages: svgPassMessages,
preparser: false,
parser: false,
Expand Down Expand Up @@ -946,7 +946,7 @@ async function designerLayoutv1ViewIterate({ context, data }) {
},
},
data: {
model: `chatgpt-4o-latest`, //`gpt-4o`,
model: process.env.LOCAL_INFERENCE_MODEL, //`gpt-4o`,
messages: svgIterateMessages,
preparser: false,
parser: false,
Expand Down
4 changes: 3 additions & 1 deletion cofounder/api/system/functions/op/llm.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ async function opLlmGen({ context, data }) {
parser = utils.parsers.parse.yaml;
}


let isOpenAi = process.env.LLM_PROVIDER.toLowerCase() === "local" || process.env.LLM_PROVIDER.toLowerCase() === "openai"
const llm_fn = !process.env.LLM_PROVIDER
? utils.openai.inference
: process.env.LLM_PROVIDER.toLowerCase() === "openai"
: isOpenAi
? utils.openai.inference
: utils.anthropic.inference;

Expand Down
2 changes: 1 addition & 1 deletion cofounder/api/system/functions/pm/brd.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ you're a genius`,
},
},
data: {
model: `chatgpt-4o-latest`, //`gpt-4o`,
model: process.env.LOCAL_INFERENCE_MODEL, //`gpt-4o`,
messages,
preparser: `backticks`,
parser: false,
Expand Down
2 changes: 1 addition & 1 deletion cofounder/api/system/functions/pm/drd.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ you're a genius`,
},
},
data: {
model: `chatgpt-4o-latest`, //`gpt-4o`,
model: process.env.LOCAL_INFERENCE_MODEL, //`gpt-4o`,
messages,
preparser: `backticks`,
parser: false,
Expand Down
2 changes: 1 addition & 1 deletion cofounder/api/system/functions/pm/fjmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ you're a genius`,
id: "op:LLM::GEN",
context,
data: {
model: `chatgpt-4o-latest`, //`gpt-4o`,
model: process.env.LOCAL_INFERENCE_MODEL, //`gpt-4o`,
messages,
preparser: `backticks`,
parser: `yaml`,
Expand Down
2 changes: 1 addition & 1 deletion cofounder/api/system/functions/pm/frd.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ you're a genius`,
},
},
data: {
model: `chatgpt-4o-latest`, //`gpt-4o`,
model: process.env.LOCAL_INFERENCE_MODEL, //`gpt-4o`,
messages,
preparser: `backticks`,
parser: false,
Expand Down
2 changes: 1 addition & 1 deletion cofounder/api/system/functions/pm/prd.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ you are a genius`,
},
},
data: {
model: `chatgpt-4o-latest`, //`gpt-4o`,
model: process.env.LOCAL_INFERENCE_MODEL, //`gpt-4o`,
messages,
preparser: `backticks`,
parser: false,
Expand Down
2 changes: 1 addition & 1 deletion cofounder/api/system/functions/pm/uxdmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ you're a genius`,
},
},
data: {
model: `chatgpt-4o-latest`, // `chatgpt-4o-latest`,//`gpt-4o`,
model: process.env.LOCAL_INFERENCE_MODEL, // `chatgpt-4o-latest`,//`gpt-4o`,
messages,
preparser: `backticks`,
parser: false,
Expand Down
2 changes: 1 addition & 1 deletion cofounder/api/system/functions/pm/uxsmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ you're a genius`,
},
},
data: {
model: `chatgpt-4o-latest`, //`gpt-4o`,
model: process.env.LOCAL_INFERENCE_MODEL, //`gpt-4o`,
messages,
preparser: `backticks`,
parser: false,
Expand Down
4 changes: 2 additions & 2 deletions cofounder/api/system/functions/swarm/augment.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ async function swarmAugmentBackendExternalapis({ context, data }) {
},
},
data: {
model: `chatgpt-4o-latest`, //`gpt-4o`,
model: process.env.LOCAL_INFERENCE_MODEL, //`gpt-4o`,
messages: messagesAnalysis,
preparser: `backticks`,
parser: false,
Expand All @@ -344,7 +344,7 @@ async function swarmAugmentBackendExternalapis({ context, data }) {
},
},
data: {
model: `chatgpt-4o-latest`, //`gpt-4o`,
model: process.env.LOCAL_INFERENCE_MODEL, //`gpt-4o`,
messages: messagesImplementMerge,
preparser: false,
parser: false,
Expand Down
4 changes: 2 additions & 2 deletions cofounder/api/system/functions/ux/datamap.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ ${uxdmd}
},
},
data: {
model: `chatgpt-4o-latest`, //`chatgpt-4o-latest`, // `chatgpt-4o-latest`,//`gpt-4o`,
model: process.env.LOCAL_INFERENCE_MODEL, //`chatgpt-4o-latest`, // `chatgpt-4o-latest`,//`gpt-4o`,
messages,
preparser: `backticks`,
parser: `yaml`,
Expand Down Expand Up @@ -490,7 +490,7 @@ you're a genius`,
},
},
data: {
model: `chatgpt-4o-latest`, //`chatgpt-4o-latest`, // `chatgpt-4o-latest`,//`gpt-4o`,
model: process.env.LOCAL_INFERENCE_MODEL, //`chatgpt-4o-latest`, // `chatgpt-4o-latest`,//`gpt-4o`,
messages,
preparser: `backticks`,
parser: `yaml`,
Expand Down
2 changes: 1 addition & 1 deletion cofounder/api/system/functions/ux/sitemap.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ You're a genius do a great job`,
},
},
data: {
model: `chatgpt-4o-latest`, // `chatgpt-4o-latest`,//`gpt-4o`,
model: process.env.LOCAL_INFERENCE_MODEL, // `chatgpt-4o-latest`,//`gpt-4o`,
messages,
preparser: `backticks`,
parser: `yaml`,
Expand Down
2 changes: 1 addition & 1 deletion cofounder/api/system/functions/webapp/root.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ async function webappRootGenerate({ context, data }) {
},
},
data: {
model: `chatgpt-4o-latest`, //`gpt-4o`,
model: process.env.LOCAL_INFERENCE_MODEL, //`gpt-4o`,
messages: messages,
preparser: false,
parser: false,
Expand Down
2 changes: 1 addition & 1 deletion cofounder/api/system/functions/webapp/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ async function webappStoreGenerate({ context, data }) {
},
},
data: {
model: `chatgpt-4o-latest`, //`gpt-4o`,
model: process.env.LOCAL_INFERENCE_MODEL, //`gpt-4o`,
messages: messages,
preparser: false,
parser: false,
Expand Down
8 changes: 4 additions & 4 deletions cofounder/api/system/functions/webapp/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ async function webappViewGenerate({ context, data }) {
},
},
data: {
model: `chatgpt-4o-latest`, //`gpt-4o`,
model: process.env.LOCAL_INFERENCE_MODEL, //`gpt-4o`,
messages: messagesFunctional,
preparser: false,
parser: false,
Expand Down Expand Up @@ -699,7 +699,7 @@ async function webappViewGenerate({ context, data }) {
},
},
data: {
model: `chatgpt-4o-latest`, //`gpt-4o`,
model: process.env.LOCAL_INFERENCE_MODEL, //`gpt-4o`,
messages: messagesRedesign,
preparser: false,
parser: false,
Expand Down Expand Up @@ -1251,7 +1251,7 @@ async function webappViewIterate({ context, data }) {
},
},
data: {
model: `chatgpt-4o-latest`, //`gpt-4o`,
model: process.env.LOCAL_INFERENCE_MODEL, //`gpt-4o`,
messages: promptMessagesNoDesigner,
preparser: false,
parser: false,
Expand Down Expand Up @@ -1415,7 +1415,7 @@ async function webappViewIterate({ context, data }) {
},
},
data: {
model: `chatgpt-4o-latest`, //`gpt-4o`,
model: process.env.LOCAL_INFERENCE_MODEL, //`gpt-4o`,
messages: mesagesIterateWithDesigner,
preparser: false,
parser: false,
Expand Down