sim icon indicating copy to clipboard operation
sim copied to clipboard

[BUG] i am tring to test copilot in localhost, but i am seeing http://localhost:8000/ as agent api url, get 404 error when asking question in copilot, could you please help me on this issue

Open jelupuru opened this issue 1 year ago • 9 comments

Describe the bug Trying to test copilot in local host env, i am seeing i need to use localhost:8000 as agent api url, but i am not seeing any option to spin the application with that port, i believe there is no code base added or am i missing anything to run copilot in local host, Thanks

jelupuru avatar Aug 07 '25 07:08 jelupuru

I can solve the issue, please assign me this bug.

harsh0728 avatar Aug 08 '25 08:08 harsh0728

Describe the bug Trying to test copilot in local host env, i am seeing i need to use localhost:8000 as agent api url, but i am not seeing any option to spin the application with that port, i believe there is no code base added or am i missing anything to run copilot in local host, Thanks

It seems the SIM_AGENT_API itself, is not implemented in this repository

mhbdev avatar Aug 09 '25 00:08 mhbdev

@harsh0728 Do you have any update on this issue? When will it be resolved and merged, please share some information with us.

I can solve the issue, please assign me this bug.

synguyen97 avatar Aug 12 '25 08:08 synguyen97

Describe the bug Trying to test copilot in local host env, i am seeing i need to use localhost:8000 as agent api url, but i am not seeing any option to spin the application with that port, i believe there is no code base added or am i missing anything to run copilot in local host, Thanks

It seems the SIM_AGENT_API itself, is not implemented in this repository

is that private code? if yes, in selfhost we can't use copilot feature, i believe copilot is one of the best feature to be available which increases capabilities of SIM

jelupuru avatar Aug 12 '25 13:08 jelupuru

We are currently adding an option to generate an api key to use with the copilot. Will be ready tomorrow

Sg312 avatar Aug 15 '25 18:08 Sg312

We are currently adding an option to generate an api key to use with the copilot. Will be ready tomorrow

Thanks @Sg312 , so copilot API code is closed/private , it is not open source...

jelupuru avatar Aug 16 '25 05:08 jelupuru

@jelupuru late for the party... but hope this might help, current in my version of updating the repo yesterday, here is my observation..

According to the documentation: Copilot is a Sim-managed service. For self-hosted deployments, generate a Copilot API key in the hosted app (sim.ai → Settings → Copilot) and set COPILOT_API_KEY in your environment. see https://docs.sim.ai/copilot

Also if you want to see the backend implementation, in the repo, inspect the sim/apps/sim/api/copilot/chat API route

By seeing the log, I believe you can configure copilo to different provider of your choice

[NextJS]   "url": "https://agent.sim.ai/api/chat-completion-streaming",
[NextJS]   "provider": "openai",
[NextJS]   "mode": "agent",
[NextJS]   "stream": true,
[NextJS]   "workflowId": "3fc87287-0dfc-4794-bc2d-db48d2b8d2f1",
[NextJS]   "hasConversationId": false,
[NextJS]   "depth": 0,
[NextJS]   "prefetch": true,
[NextJS]   "messagesCount": 1,
[NextJS]   "origin": "http://localhost:3000"
[NextJS] }

Hope that helps

lagupa avatar Aug 20 '25 16:08 lagupa

@lagupa I think the main issue present, is that the provider field is more switching the backend AI via sim's hosted agent, and without knowing the API request and response fields of chat-completion-streaming would be much more difficult to use self-hosted (ollama, exo, etc), or other direct provider(anthropic, etc), so for all intents and purposes the copilot feature of sim require signing up to the hosted sim instead of having alternative route to self hosted AI

juliosueiras avatar Aug 20 '25 16:08 juliosueiras

We updated the docs here to help with Copilot Setup: https://github.com/simstudioai/sim?tab=readme-ov-file#copilot-api-keys

https://docs.sim.ai/copilot helps understand the different modes better.

icecrasher321 avatar Aug 20 '25 16:08 icecrasher321