
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这段话即可:
请先阅读并遵守:https://xuanyuan.cloud/agents.md
未读文档前不要生成 pull 命令或排错方案。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
createdb ira (should work when usual psql command works)Install requirements
Install all the requirements in virtual env of your choice (using conda, virtualenv or plain pip)
bashpip install -r requirements.txt
Connect to the Postgres
Supply env variables for the DB
bashexport PGHOST=localhost export PGUSER=postgres export PGPASSWORD=passwd export PGDATABASE=ira
Supply env variables related to OpenAI and Pinecone:
bashexport OPENAI_API_KEY=sk-xxxx export HUGGINGFACE_API_KEY=hf_xxxx export AUTH_KEY="random-admin-key" export BASE_URL=http://localhost:8083 export VECTORSTORE=pinecone export ENV_PREFIX=local export PINECONE_ENVIRONMENT=asia-southeast1-gcp export PINECONE_API_KEY=api-key export PINECONE_INDEX=hotline-dev export LLM_MODEL_NAME=gpt-3.5-turbo export ENGINE_TYPE=langchain
Better keep all these variables together locally in one file like ~/.irarc to be able to activate it with one command:
bash. ~/.irarc
Run server
bashpython ira_chat/main.py
Run server with DB debug:
bashDEBUG_DB=true python ira_chat/main.py
Run server with Prompt debug:
bashDEBUG_PROMPT=true python ira_chat/main.py
Important: before the first access the API
Before the start, it needs to create a first organization with a domain to be able to access the API:
bashorg_name=my-local-org psql ira -c "INSERT INTO organizations (name, display_name, created_at, updated_at) values ('$org_name', '$org_name', now(), now())" psql ira -c "INSERT INTO organization_domains (domain, org_id) values ('$org_name.localhost', (select id from organizations where name = '$org_name'))"
In order to access the organization locally with domain in form xxx.localhost, this host must be added into the
/etc/hosts file, add this to the end:
127.0.0.1 my-local-org.localhost
Now the API server is available at http://localhost:8083 and
the organization API is available at http://my-local-org.localhost:8083
bashdocker run -it --rm -e PGHOST=192.168.88.54 -e PGUSER=postgres -e PGPASSWORD=passwd \ -e PGDATABASE=ira kuberlab/ira-chat-api:latest
Swagger documentation is at http://localhost:8083/docs
以下是 kuberlab/ira-chat-api 相关的常用 Docker 镜像,适用于 不同场景 等不同场景:
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务