Skip to main content

A local-first AI workspace for long-form fiction writing.

Project description

OmniFic Backend

Python FastAPI 后端,提供 REST API、Agent Runtime、WebSocket、数据库管理。

技术栈

  • Python 3.12+
  • FastAPI — Web 框架
  • SQLAlchemy / SQLModel — ORM + 数据库模型
  • SQLite — 本地数据库
  • LangChain / LangGraph — Agent 框架
  • ZeroMQ — 后台任务通信
  • httpx — HTTP 客户端
  • LanceDB / FastEmbed — RAG 检索与嵌入

项目结构

backend/app/
├── api/routers/      # REST API 路由
├── agent_runtime/    # Agent 运行时(图、工具、上下文)
├── storage/          # 数据模型、仓库、服务
├── models/           # LLM 客户端、提供商、目录
├── reading/          # 书架搜索(实验性)
├── background/       # 后台任务(标题生成、摘要)
├── core/             # 工具函数(TXT 解析、文档解析、错误)
├── settings.py       # 应用配置
└── main.py           # 入口

快速开始

cd backend
uv sync
uv run uvicorn app.main:app --host 127.0.0.1 --port 8001 --app-dir .

环境变量

变量 默认值 说明
OMNIFIC_SERVER_HOST 127.0.0.1 监听地址
OMNIFIC_SERVER_PORT 8000 监听端口
OMNIFIC_DATA_DIR backend/data 数据目录
OMNIFIC_FRONTEND_DIST frontend/dist 前端构建产物路径

数据库迁移

alembic -c alembic.ini upgrade head
alembic -c alembic.ini revision --autogenerate -m "description"
alembic -c alembic.ini downgrade -1

测试

pytest
pytest tests/api/test_tasks.py -v

API 路由

前缀 模块
/api/v1/projects 项目管理
/api/v1/characters 角色管理
/api/v1/world-info 世界书
/api/v1/models 模型管理
/api/v1/settings 用户设置
/api/v1/agent Agent 会话
/api/v1/import TXT 导入
/api/v1/bookshelf 书架搜索(实验)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

omnific-0.8.0.tar.gz (47.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

omnific-0.8.0-py3-none-any.whl (47.9 MB view details)

Uploaded Python 3

File details

Details for the file omnific-0.8.0.tar.gz.

File metadata

  • Download URL: omnific-0.8.0.tar.gz
  • Upload date:
  • Size: 47.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for omnific-0.8.0.tar.gz
Algorithm Hash digest
SHA256 e87046e69d481df2ed2731ccd313f419b358f415a2e068d34424e750ca9401df
MD5 8e3dc7820d75b65d43ae7cb8657944c4
BLAKE2b-256 c3a9184df2eb76a603eba6f39bd74231cc26bcf2af4d082599a3be5dee018e8c

See more details on using hashes here.

Provenance

The following attestation bundles were made for omnific-0.8.0.tar.gz:

Publisher: package.yml on F0rJay/OmniFic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file omnific-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: omnific-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 47.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for omnific-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1e9dfb847402c0f469bf0fa38fdf6d9046e77a631bb9a10095958221e4bc93e2
MD5 e3c8c2949dfbccd9460e157839cebee4
BLAKE2b-256 f169691229d7d0fb7599e1b3c02eee5f5d30cfdfc6741eb4b105aec17d243e2b

See more details on using hashes here.

Provenance

The following attestation bundles were made for omnific-0.8.0-py3-none-any.whl:

Publisher: package.yml on F0rJay/OmniFic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page