BuilderIO / micro-agent

An AI agent that writes (actually useful) code for you
https://www.builder.io/blog/micro-agent
MIT License
2.54k stars 201 forks source link

Groq API problems with micro agent #51

Open mackimart1 opened 1 month ago

mackimart1 commented 1 month ago

I've been trying to solve this issue to be able to use Groq API with micro-agent, I've made .bat and even .py scripts to try to run the API/ LLM model correctly but no avail, I'm very interested in this project and would love to see how we can improve and grow, any assistance would be great thank you for your time.

C:\Users\USER>micro-agent config set OPENAI_API_ENDPOINT=*** (node:28380) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. (Use node --trace-deprecation ... to show where the warning was created) | — Config updated ✅

C:\Users\user>micro-agent config set OPENAI_API_ENDPOINT=https://api.groq.com/openai/v1 (node:22840) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. (Use node --trace-deprecation ... to show where the warning was created) | — Config updated ✅

C:\Users\user>micro-agent config set MODEL=llama3-8b-8192 (node:31152) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. (Use node --trace-deprecation ... to show where the warning was created) | — Config updated ✅

C:\Users\user>micro-agent (node:26400) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. (Use node --trace-deprecation ... to show where the warning was created)

T 🦾 Micro Agent o What would you like to do? I want to improve my neural network

✖ model 'llama3-8b-8192' not found, try pulling it first at checkOk (file:///C:/Users/user/AppData/Roaming/npm/node_modules/@builder.io/micro-agent/node_modules/ollama/dist/shared/ollama.d8c046e0.mjs:70:9) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async post (file:///C:/Users/user/AppData/Roaming/npm/node_modules/@builder.io/micro-agent/node_modules/ollama/dist/shared/ollama.d8c046e0.mjs:117:3) at async Ollama.processStreamableRequest (file:///C:/Users/user/AppData/Roaming/npm/node_modules/@builder.io/micro-agent/node_modules/ollama/dist/shared/ollama.d8c046e0.mjs:229:25) at async getSimpleCompletion (file:///C:/Users/user/AppData/Roaming/npm/node_modules/@builder.io/micro-agent/dist/cli.mjs:1034:22) at async getFileSuggestion (file:///C:/Users/user/AppData/Roaming/npm/node_modules/@builder.io/micro-agent/dist/cli.mjs:949:9) at async interactiveMode (file:///C:/Users/user/AppData/Roaming/npm/node_modules/@builder.io/micro-agent/dist/cli.mjs:730:33) at async file:///C:/Users/user/AppData/Roaming/npm/node_modules/@builder.io/micro-agent/dist/cli.mjs:1712:11

ai-shell v0.1.3

Please open a Bug report with the information above:
https://github.com/BuilderIO/micro-agent/issues/new

x Canceled
"

steve8708 commented 1 month ago

what is your OPENAI_API_ENDPOINT? for groq it needs to be https://api.groq.com/openai/v1

qaribhaider commented 1 week ago

@steve8708 I guess I can see the url in the reported bug as well, which is the same url as in the documents. But to confirm I faced the same issue, here are the steps to reproduce this:

npm install -g @builder.io/micro-agent
micro-agent config set OPENAI_KEY=************
micro-agent config set MODEL=llama3-8b-8192
micro-agent config set OPENAI_API_ENDPOINT=https://api.groq.com/openai/v1
│
└  Config updated ✅

│
└  Config updated ✅

│
└  Config updated ✅
micro-agent                                                                               

┌  🦾 Micro Agent
│
◇  What would you like to do?
│  A function that returns whether a given number is even or odd
│

✖ model "llama3-8b" not found, try pulling it first

I tried changing the model as well, but to no avail.