Skip to content

Add /llms.txt to docs for LLM context#3194

Merged
vasfvitor merged 6 commits intotauri-apps:v2from
jeremygiberson:jeremygiberson/3144/add-llms-txt-gen
Apr 2, 2025
Merged

Add /llms.txt to docs for LLM context#3194
vasfvitor merged 6 commits intotauri-apps:v2from
jeremygiberson:jeremygiberson/3144/add-llms-txt-gen

Conversation

@jeremygiberson
Copy link
Copy Markdown
Contributor

Description

I ran this #3144 this morning when I wanted tauri docs in my RAG. Since I was already yak shaving I decided to lend a hand for this feature. I would by no means call this ready to go -- it's just a little push. This was my first time working with Astro so I'm kind of just winged it figuring out how to do it w/ disregard to whether I should in this particular way.

Ultimately I created 3 endpoints

  1. src/pages/llms.txt.ts -> /llms.txt supplies minimum functionality of generating an LLM friendly document
  2. src/pages/llms.toc.txt.ts -> /llms.toc.txt serves as a directory listing of all the various documentation topics with a link to a full llms.txt for just the specified category.
  3. src/page/[...llm_slug].ts -> /<some>/<content_slug>/llms.txt renders the llms.txt for just the specified documentation. Mirrors the existing content slugs and appends /llms.txt to it. Ie, /security/scope/ now has a matching /security/scope/llms.txt.

My thoughts on 2 and 3 is to support a model or rag workflow that supports reasoning and fetching then it might be happy to start with an index and figure out where it can grab more docs that it cares about. I don't know how practical it is. /shrug

@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 5, 2025

Deploy Preview for tauri-v2 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit fb082ee
🔍 Latest deploy log https://app.netlify.com/sites/tauri-v2/deploys/67ed60e57b05a400086812bb
😎 Deploy Preview https://deploy-preview-3194--tauri-v2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@watzon
Copy link
Copy Markdown

watzon commented Mar 29, 2025

This is great. What is needed to get it merged?
Also would you be able to pastebin an llms.txt for this in the meantime?

Comment thread src/pages/[...llm_slug].ts Outdated
@@ -0,0 +1,53 @@
import { getCollection } from "astro:content";
import type { APIRoute } from "astro";
import { doc } from "prettier";
Copy link
Copy Markdown
Contributor

@vasfvitor vasfvitor Mar 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is doc being used? if so, isn't it confliting in lines 39 and 40? (if you can't get back to it right now, let me know and I'll take care myself)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delayed reply, the PR fell off my radar.

You're absolutely correct. I believe this was an unintentional auto import that I didn’t notice.

Will remove it.

@vasfvitor
Copy link
Copy Markdown
Contributor

oh man I'm sorry, I intended to review this right when it was open but didn't. Thanks for this work, I hope we can merge this already.

@vasfvitor
Copy link
Copy Markdown
Contributor

@watzon in the meanwhile you can see the preview, for instance https://deploy-preview-3194--tauri-v2.netlify.app/llms.txt

Copy link
Copy Markdown
Contributor Author

@jeremygiberson jeremygiberson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unnecessary import

Comment thread src/pages/[...llm_slug].ts Outdated
@vasfvitor vasfvitor merged commit c1919b4 into tauri-apps:v2 Apr 2, 2025
9 checks passed
@vasfvitor
Copy link
Copy Markdown
Contributor

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants