Giter Site home page Giter Site logo

bitswired / fuseai Goto Github PK

View Code? Open in Web Editor NEW
290.0 12.0 45.0 1.05 MB

Self-Hosted and Open-Source web app to interact with OpenAI APIs. Currently supports ChatGPT, but DALLE and Whisper support is coming.

Shell 0.05% JavaScript 4.35% Nix 0.34% TypeScript 94.33% Dockerfile 0.93%
ai fullstack mantine nextauth nextjs prisma react trpc typescript

fuseai's People

Contributors

barnito avatar dennisthed avatar jimzer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fuseai's Issues

the welcome page goes to the wrong `chats` page

when clicking the Start By Visiting The Chat Page To Create A New Chat button it redirects you to /chat, which does not exists (should be /chats), you probably are already aware of this but..

Docker image not available

Docker image is not available in repository. When I'm trying to pull it, I'm getting error:
Error response from daemon: pull access denied for bitswiredpods/ai-chat-app, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

secret missing in docker image.

the new docker image produce this error on my side:

[next-auth][error][NO_SECRET]
https://next-auth.js.org/errors#no_secret
Warning: For production Image Optimization with Next.js, the optional 'sharp' package is strongly recommended. Run 'yarn add sharp', and Next.js will use it automatically for Image Optimization.
Read more: https://nextjs.org/docs/messages/sharp-missing-in-production
[next-auth][error][NO_SECRET]
https://next-auth.js.org/errors#no_secret Please define a secret in production. MissingSecret [MissingSecretError]: Please define a secret in production.
at assertConfig (/app/node_modules/next-auth/core/lib/assert.js:42:12)
at AuthHandler (/app/node_modules/next-auth/core/index.js:70:52)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async NextAuthHandler (/app/node_modules/next-auth/next/index.js:24:19)
at async /app/node_modules/next-auth/next/index.js:60:32
at async Object.apiResolver (/app/node_modules/next/dist/server/api-utils/node.js:372:9)
at async NextNodeServer.runApi (/app/node_modules/next/dist/server/next-server.js:514:9)
at async Object.fn (/app/node_modules/next/dist/server/next-server.js:828:35)
at async Router.execute (/app/node_modules/next/dist/server/router.js:243:32)
at async NextNodeServer.runImpl (/app/node_modules/next/dist/server/base-server.js:432:29) {
code: 'NO_SECRET'
}
[next-auth][error][NO_SECRET]
https://next-auth.js.org/errors#no_secret
[next-auth][error][NO_SECRET]
https://next-auth.js.org/errors#no_secret
[next-auth][error][NO_SECRET]
https://next-auth.js.org/errors#no_secret
[next-auth][error][NO_SECRET]
https://next-auth.js.org/errors#no_secret Please define a secret in production. MissingSecret [MissingSecretError]: Please define a secret in production.

pressing submit does nothing

running the container with the following command results in chats not working, the API key saves, and when I click submit it thinks, but does nothing:

docker run -p 8113:3000 \
  -e DATABASE_URL=file:./db.sqlite \
  -e NEXTAUTH_SECRET=secret \
  -e NEXTAUTH_URL=http://192.168.1.2:8113/ \
  -e [email protected] \
  -e ADMIN_PASSWORD=password \
  bitswired/ai-chat-app:single-user-latest

same behaviour on unraid and an M1 MacBook
should note it used to work.

possible related error:

prisma:error 
Invalid `prisma.user.findUniqueOrThrow()` invocation:


An operation failed because it depends on one or more records that were required but not found. Expected a record, found none.

full logs:

yarn run v1.22.19
$ /app/node_modules/.bin/prisma migrate deploy
Prisma schema loaded from prisma/schema.prisma
Datasource "db": SQLite database "db.sqlite" at "file:./db.sqlite"

SQLite database db.sqlite created at file:./db.sqlite

6 migrations found in prisma/migrations

Applying migration `20230302135639_init`
Applying migration `20230303145339_cascade_delete`
Applying migration `20230303183658_add_settings`
Applying migration `20230303235937_add_templates`
Applying migration `20230312154530_auth`
Applying migration `20230312205338_add_tenant_id`

The following migrations have been applied:

migrations/
  └─ 20230302135639_init/
    └─ migration.sql
  └─ 20230303145339_cascade_delete/
    └─ migration.sql
  └─ 20230303183658_add_settings/
    └─ migration.sql
  └─ 20230303235937_add_templates/
    └─ migration.sql
  └─ 20230312154530_auth/
    └─ migration.sql
  └─ 20230312205338_add_tenant_id/
    └─ migration.sql
      
All migrations have been successfully applied.
Done in 4.75s.
yarn run v1.22.19
$ next start
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
Warning: For production Image Optimization with Next.js, the optional 'sharp' package is strongly recommended. Run 'yarn add sharp', and Next.js will use it automatically for Image Optimization.
Read more: https://nextjs.org/docs/messages/sharp-missing-in-production
prisma:error 
Invalid `prisma.user.findUniqueOrThrow()` invocation:


An operation failed because it depends on one or more records that were required but not found. Expected a record, found none.
[next-auth][error][JWT_SESSION_ERROR] 
https://next-auth.js.org/errors#jwt_session_error No User found {
  message: 'No User found',
  stack: 'NotFoundError: No User found\n' +
    '    at /app/node_modules/@prisma/client/runtime/library.js:164:6701\n' +
    '    at async /app/node_modules/@prisma/client/runtime/library.js:164:6641\n' +
    '    at async Object.session (/app/.next/server/chunks/887.js:122:30)\n' +
    '    at async Object.session (/app/node_modules/next-auth/core/routes/session.js:56:26)\n' +
    '    at async AuthHandler (/app/node_modules/next-auth/core/index.js:158:27)\n' +
    '    at async NextAuthHandler (/app/node_modules/next-auth/next/index.js:24:19)\n' +
    '    at async /app/node_modules/next-auth/next/index.js:60:32\n' +
    '    at async Object.apiResolver (/app/node_modules/next/dist/server/api-utils/node.js:372:9)\n' +
    '    at async NextNodeServer.runApi (/app/node_modules/next/dist/server/next-server.js:514:9)\n' +
    '    at async Object.fn (/app/node_modules/next/dist/server/next-server.js:828:35)',
  name: 'NotFoundError'
}
[Object: null prototype] {
  username: '[email protected]',
  password: 'password',
  callbackUrl: '/',
  csrfToken: '3baf6d861c0b1c5ec1f7b98587874984b2ccf9409eb261b5f2696262ef38a825',
  json: 'true'
} true true
JDDDDDDDIIIIDDD
[Object: null prototype] {
  username: '[email protected]',
  password: 'password',
  callbackUrl: '/',
  csrfToken: '12ddaa65f016860d5b00a21904d3b9d55d8ead83641375419328ce50f06d4a81',
  json: 'true'
} true true
JDDDDDDDIIIIDDD

Naming chats: layout suggestion and feature request "auto-name"

  1. When naming chats, the layout is unnecessarily using up a lot of space.

image

Instead of the current design, a simple pencil icon next to the text or an ellipsis (...) menu with Delete and Rename options could be used.

  1. A feature request is to add an auto-naming feature using a GPT prompt:
  • After the first user input, a separate GPT call with a prompt (to be designed) can generate a name based on the initial user input.
  • Rename the chat from "New Chat" to the generated name.
  • A toggle in Settings can be added to turn this feature off, as it would save on tokens.

Bug: Copy Code button not copying to clipboard

Using Arc browser (Chromium), the copy button comes up correctly with a codeblock but does not actually copy to the clipboard.
Screenshot of Arc
(Button in corner is clickable but doesn't copy to clipboard)

Mobile version

Hi,

It's possible to have a mobile version with PWA?

Thanks

Multi-user requirements

Very good job! I have some friends that are located in areas where openai is banned, and I thought if the software had multi-user capabilities, I could make a client that would be easy for them to use.

I wonder if this is in the plan of the roadmap?

Input box is off-center

image

Margins come up as 470-something when it should be 300. Happens on both Chrome and Safari on OSX.

Great work! Super clean and attractive app.

Quality of life tips/features

Hi! I really love this app so far, but I would love to contribute with some QOL improvements to make it a smoother experience for any users. I don't have much coding experience, but I hope this can help to improve the app greatly. I am currently running it on a Docker from my unraid server, just fyi.

  • In most cases when saving settings, you don't automatically get sent back to a previous screen, which makes it unclear for the user that anything actually happened. This happens both on the OpenAI key screen in settings and when renaming a chat in the sidebar that opens.
  • Is it possible to edit the setup prompt? "You are a helpful assistant" might not be useful in all use cases.
  • More templates would be amazing - maybe give users an option to share templates to a global database?
  • Please allow us to rename chats and templates in their respective overview screens, i.e. by double-clicking the current template/chat > double-clicking to rename items in the right sidebar would also be amazing
  • Highlight the current chat in the right sidebar in the "Chats" screen
  • In the menu on the left, it would potentially be useful to show a few recents chats as sub-menu items.
  • In the menu on the left, it would be useful to add "Manage templates" and "Import templates" as a sub-menu under "Templates"
  • Clear the input field when a message has been sent to the API.
  • Allow usage of ENTER to send a message and CTRL + ENTER to add another line in the text field. Possibly add an option to the Settings page to customize this behavior.
  • Give us the option to edit templates
  • Adding an option for a global password and/or (admin-approvable) user accounts would increase the security and potential usage for teams/work
  • If you add users, add internal sharing of prompts? > i.e. I want to share certain prompts only with my colleagues
  • When adding multiple parameters in templates with the same name, it would be great if you'd only have to fill it in one time. I have a template which has multiple usages of {keyword} in it, but I have to fill it in separately for all 4 mentions.

Sorry if this is a bit much, but I think these are some amazing features and QOL to add to the app! I hope the list is useful and thanks for the amazing work you've put into it so far.

Submit button not submitting

When hitting the submit button, it does not submit the text. It will load momentarily then stop and nothing changes. Fresh install.

Utilizing Unraid Docker.

can we change the AI model?

Open AI just release ChatGPT API using "gpt-3.5-turbo" model. Not only because that is the actual ChatGPT, the popular one, but also it is much cheaper than "text-davinci-003".

Error on create new chat

"On Ai CHAT's chat page, the 'create new chat' button does not appear when there is no active chat present."

License Missing?

Hello,

I wasn't able to find a license associated with the project. Consequently, all right are reserved and the project is not Open Source. Would the authors consider adding an Open Source license?

Thanks

Utilise Dalai API for Local Llama/Alpaca AI

Hi,
It would be great, seeing as this is a self-hosted project anyway, to have it also give the ability to connect to the dalai service created by this project:
https://github.com/cocktailpeanut/dalai

The project is designed specifically for interaction with the Llama and Alpaca models, of all sizes. It has it's own web interface but it's more just for testing than actual production like ai-chat-app is.

Missing Templates

It seems that the templates are now missing. I did a fresh install on my unraid server and while everything is working. There are no templates in either the [Manage Templates] or [Import Templates]. Was there a change that may have cause this?

Feature (QoL improvement): Reorder chats on sidebar.

Proposed feature: reorder the chats on the sidebar by drag and dropping them. Would be nice to keep things orderly, maybe also include an archive feature where the chats appear in search but not on the base sidebar.

No chat output.

Deployed the container, added the api key, started a new chat, entered some text and nothing is displayed in the output... tried two different browsers same results.
the api key is marked as used on the admin pannel of open ai.
as i can't find a log file to help me figure out what is happening i am opening an issue :)

Feature Request: Add support to import saved chats from ChatGPT

I have hundreds of chats I have saved in the json format supported by OpenAI in ChatGPT.

To transition to FuseAI I would need to be able to import my chat history from ChatGPT.

Even with my heavy use of ChatGPT if I was using the API for access for all my chats I think it would be significantly less the $20 + tax per month to run. It would be a killer product if it had this.

No response after longer interactions

I don’t know if this is a bug or an issue on openai’s api side. After longer constant conversations going back and forth suddenly no responses come back. As soon as I open a new chat I am good to go again and can continue interacting with the api until it stops again. Can you give me a hint as to how I might be able to debug this and shed some more light onto this issue?

Alternatively some error messages in the UI might be helpful for the user to understand what’s going on.

Add User

Hello,
I have an add user button and can add an email; I do not see how to add a password for that user.

Chas

Enhancement ideas

I saw you post on reddit and now I got time to check it out! This is really great. Thanks a lot for sharing! Unfortunately, I am illiterate in JavaScript, I only know Python so I am unable to contribute actively but was wondering if you could add the following features:

  • Option to edit the templates
  • Change the used model and fine tune the model settings

Feature Request: Editable Messages

Something that is missing from even the official ChatGPT page is the ability to edit all messages, not just the user messages. I'd like to be able to edit any message within the chat conversation, and all future requests would be updated with the other information. Specifically I'd like to see the ability to edit the 'system' message at the start of the chat to define how you want the AI to behave, as well as the user and AI response chats.

An easy to see use-case for this is having the AI generate code, but it uses a variable name that you don't like. Instead of going back and forth with it to fix it, you can just edit it's code to include the correct name, all future messages should use that variable name instead.

In addition it would be useful to be able to entirely delete messages. For instance you could have a couple of messages that setup the AI to do a task, then a message asking it to do a task, (generate a Jest test for a given function, for example), then when you want a new one you can just delete the response and your message and send another request without having to do all the setup messages.

Being able to manipulate the chat history seems extremely useful, and should be doable based on the OpenAI API.

NEXT_PUBLIC_MULTI_USER/New users & emails

Part of this might be similar to issue #39

Part 1:
When I add the env variable(NEXT_PUBLIC_MULTI_USER with 1) in unraid and try to login as the admin account it just clears the form and doesn't log me in. It also has a dead image logo icon instead of the orange robot.

When I remove the NEXT_PUBLIC_MULTI_USER variable, it lets me log into the container just fine.

Part 2:
When I try and send an invite by email for new user, the emails don't get sent.
This might be related to a missing env variable for TLS or STARTTLS.

I use Proton mail business account to use my website domain name for emails sent to people.
This works fine in all the dockers I have tried, just not this one.

The strange part is, I'm not getting any error when I do go to Accounts > Create New User. No email is sent to that user.

Auto naming chats (using ChatGPT)

From #20

A feature request is to add an auto-naming feature using a GPT prompt:
After the first user input, a separate GPT call with a prompt (to be designed) can generate a name based on the initial user input.
Rename the chat from "New Chat" to the generated name.
A toggle in Settings can be added to turn this feature off, as it would save on tokens.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.