LectuLibre
A book translation platform based on large language models that allows users to upload EPUB or PDF books and have them translated into multiple languages by an LLM; its backend uses a FastAPI and PostgreSQL architecture to implement multilingual full-text search.
Timeline (last 90 days)
LectuLibre is an AI book translation platform that allows users to upload EPUB or PDF books, and the system calls large models such as Claude and DeepSeek to complete the translation, ultimately forming a library where the same book exists in multiple languages.
After evaluating at the scale of a single VPS with several hundred thousand documents, LectuLibre concluded that PostgreSQL's built-in full-text search is sufficient, with no need to introduce Elasticsearch.
LectuLibre initially stored translations as JSON columns, and queries required constant JSON parsing, which was both painful and slow; after normalizing into a separate table, queries became cleaner and could directly leverage PostgreSQL's full-text search capabilities.
LectuLibre's translations table contains chapter_id, language, content, and content_tsv columns, among which content_tsv is created as a generated column, with the database responsible for the generation logic and no manual maintenance needed at the application layer.
LectuLibre uses a PostgreSQL trigger function to automatically recompute content_tsv before INSERT or UPDATE, so the application layer does not need to care about index updates at all.
LectuLibre builds a gin_trgm_ops index on books.title, and at query time filters with similarity(Book.title, q) > 0.3 and sorts by similarity, reducing fuzzy title search from 1.2s to 15ms.
All Facts (6)
LectuLibre is an AI book translation platform that allows users to upload EPUB or PDF books, and the system calls large models such as Claude and DeepSeek to complete the translation, ultimately forming a library where the same book exists in multiple languages.
50%UnverifiedAfter evaluating at the scale of a single VPS with several hundred thousand documents, LectuLibre concluded that PostgreSQL's built-in full-text search is sufficient, with no need to introduce Elasticsearch.
50%UnverifiedLectuLibre's translations table contains chapter_id, language, content, and content_tsv columns, among which content_tsv is created as a generated column, with the database responsible for the generation logic and no manual maintenance needed at the application layer.
50%UnverifiedLectuLibre uses a PostgreSQL trigger function to automatically recompute content_tsv before INSERT or UPDATE, so the application layer does not need to care about index updates at all.
50%UnverifiedLectuLibre builds a gin_trgm_ops index on books.title, and at query time filters with similarity(Book.title, q) > 0.3 and sorts by similarity, reducing fuzzy title search from 1.2s to 15ms.
50%UnverifiedLectuLibre initially stored translations as JSON columns, and queries required constant JSON parsing, which was both painful and slow; after normalizing into a separate table, queries became cleaner and could directly leverage PostgreSQL's full-text search capabilities.
50%