sqlchat / sqlchat

Chat-based SQL Client and Editor for the next decade

Home Page:https://sqlchat.ai

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Please sign up to get free quota.

elgerm opened this issue · comments

Describe the bug

Not sure if this is a configuration issue but seems like a bug. Using hosted docker to run and added my own API key from openai.
Connection to my database works, but then when I ask anything I only get 'Please sign up to get free quota'.

To reproduce

docker compose file:

version: '3.7'
services:
sqlchat:
hostname: localhost
image: sqlchat/sqlchat:latest
environment:
NEXTAUTH_SECRET: 'secret'
NEXT_PUBLIC_USE_DATABASE: 'true'
NEXT_PUBLIC_DATABASE_URL: 'postgresql://'
OPENAI_API_KEY: '
'
NEXT_PUBLIC_ALLOW_SELF_OPENAI_KEY: 'true'
networks:
- ***
logging:
driver: json-file
options:
max-size: 3m
ports:
- 3000:3000
restart: on-failure

networks:
***:
external: true
name: ***

Additional context

No response

This is expected.

Your setting is similar to sqlchat.ai, which offers a hosted service for end users. It requires the user to log in to use the OPENAI_API_KEY you set in the config.

If you only intend to use for yourself. You only need to supply

NEXTAUTH_SECRET: 'secret'
OPENAI_API_KEY: 'xxx'

See README https://github.com/sqlchat/sqlchat?tab=readme-ov-file#docker for details.

Hi,

Thanks but, I did specify my api key.
In my example above I put 3 stars everywhere I wanted to hide my info but markdown removed it, making it look like I didn't configure the api key (which I did).

Elger

Because you provide the database as well, which implies running a hosted service for others to use. Because the database is used to store the account and usage information. Then when you visit the running SQL Chat, you act as an end user consuming the SQL Chat, thus quota logic is enforced.

As mentioned in the previous comment. You Only need to supply:

NEXTAUTH_SECRET: 'secret'
OPENAI_API_KEY: 'xxx'

No database, no quota logic