-
Notifications
You must be signed in to change notification settings - Fork 258
Add llms.txt implementation for improved AI/LLM visibility #16656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f294adb
feat: Add llms.txt implementation for AI/LLM consumption
asafashirov e9bc8ab
fix: Remove specific metrics claim from llms.txt blockquote
asafashirov de16f46
fix: Address PR review feedback for llms.txt implementation
asafashirov fc48377
feat: Address sicarul's feedback on llms.txt implementation
asafashirov 45acecb
Simplify llms.txt implementation
asafashirov 2bc1e34
Simplify llms.txt structure
asafashirov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| {{- /* Generate llms.txt file for AI/LLM consumption */ -}} | ||
| {{- /* Static version for now - dynamic generation can be enabled later */ -}} | ||
| # Pulumi | ||
|
|
||
| > Infrastructure as code using real programming languages. Write, test, and deploy cloud infrastructure with TypeScript, Python, Go, C#, or Java instead of YAML. Get IDE support, type safety, and automated testing for AWS, Azure, GCP, Kubernetes, and 150+ providers. | ||
|
|
||
| ## Getting Started | ||
|
|
||
| {{- range where .Site.RegularPages "Section" "docs" }} | ||
| {{- if and (in .RelPermalink "/get-started/") (not (isset .Params "llms_exclude")) }} | ||
| - [{{ .Title }}]({{ .Permalink }}){{ if .Params.meta_desc }} - {{ .Params.meta_desc }}{{ end }} | ||
| {{- end }} | ||
| {{- end }} | ||
| - [Core Concepts](https://www.pulumi.com/docs/iac/concepts/) - Projects, stacks, resources, and state | ||
|
|
||
| ## Infrastructure as Code (IaC) | ||
|
|
||
| - [Why Pulumi?](https://www.pulumi.com/docs/iac/) - Real code vs YAML configuration | ||
| {{- range where .Site.RegularPages "Section" "docs" }} | ||
| {{- if and (in .RelPermalink "/iac/") (not (in .RelPermalink "/get-started/")) (not (isset .Params "llms_exclude")) }} | ||
| {{- if or (in .RelPermalink "/languages-sdks/") (in .RelPermalink "/clouds/") (in .RelPermalink "/cli/") (in .RelPermalink "/automation-api/") (in .RelPermalink "/crossguard/") (in .RelPermalink "/adopting-pulumi/") }} | ||
| - [{{ .Title }}]({{ .Permalink }}){{ if .Params.meta_desc }} - {{ .Params.meta_desc | truncate 100 }}{{ end }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- end }} | ||
|
|
||
| ## Pulumi ESC (Environments, Secrets, Configuration) | ||
|
|
||
| {{- range where .Site.RegularPages "Section" "docs" }} | ||
| {{- if and (in .RelPermalink "/esc/") (not (isset .Params "llms_exclude")) }} | ||
| {{- if or (eq .RelPermalink "/docs/esc/") (in .RelPermalink "/get-started/") (in .RelPermalink "/environments/") (in .RelPermalink "/integrations/") (in .RelPermalink "/cli/") }} | ||
| - [{{ .Title }}]({{ .Permalink }}){{ if .Params.meta_desc }} - {{ .Params.meta_desc | truncate 100 }}{{ end }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- end }} | ||
|
|
||
| ## Pulumi Cloud Platform | ||
|
|
||
| {{- range where .Site.RegularPages "Section" "docs" }} | ||
| {{- if and (in .RelPermalink "/pulumi-cloud/") (not (isset .Params "llms_exclude")) }} | ||
| {{- if or (eq .RelPermalink "/docs/pulumi-cloud/") (in .RelPermalink "/deployments/") (in .RelPermalink "/copilot/") (in .RelPermalink "/access-management/") (in .RelPermalink "/admin/") }} | ||
| - [{{ .Title }}]({{ .Permalink }}){{ if .Params.meta_desc }} - {{ .Params.meta_desc | truncate 100 }}{{ end }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- end }} | ||
| - [Pulumi Insights](https://www.pulumi.com/docs/insights/) - Infrastructure intelligence and search | ||
|
|
||
| ## Registry (Providers & Packages) | ||
|
|
||
| - [AWS Provider](https://www.pulumi.com/registry/packages/aws/) - Complete AWS resource coverage | ||
| - [Azure Native Provider](https://www.pulumi.com/registry/packages/azure-native/) - Full Azure ARM API | ||
| - [Google Cloud Provider](https://www.pulumi.com/registry/packages/gcp/) - Complete GCP coverage | ||
| - [Kubernetes Provider](https://www.pulumi.com/registry/packages/kubernetes/) - Native Kubernetes support | ||
| - [All Providers](https://www.pulumi.com/registry/) - 150+ cloud and SaaS providers | ||
|
|
||
| ## API Reference | ||
|
|
||
| - [Node.js/TypeScript](https://www.pulumi.com/docs/reference/pkg/nodejs/) - Complete TypeScript/JavaScript API | ||
| - [Python](https://www.pulumi.com/docs/reference/pkg/python/) - Complete Python API | ||
| - [Go](https://www.pulumi.com/docs/reference/pkg/go/) - Complete Go API | ||
| - [.NET/C#](https://www.pulumi.com/docs/reference/pkg/dotnet/) - Complete .NET API | ||
| - [Java](https://www.pulumi.com/docs/reference/pkg/java/) - Complete Java API | ||
|
|
||
| ## Tutorials & Examples | ||
|
|
||
| {{- $tutorials := where .Site.RegularPages "Section" "tutorials" }} | ||
| {{- range first 10 $tutorials }} | ||
| {{- if not (isset .Params "llms_exclude") }} | ||
| - [{{ .Title }}]({{ .Permalink }}){{ if .Params.meta_desc }} - {{ .Params.meta_desc | truncate 100 }}{{ end }} | ||
| {{- end }} | ||
| {{- end }} | ||
| - [More Tutorials](https://www.pulumi.com/tutorials/) - Complete list of hands-on learning paths | ||
| - [Examples](https://github.com/pulumi/examples) - Production-ready templates | ||
| - [Templates](https://www.pulumi.com/templates/) - Starter templates for common architectures | ||
|
|
||
| ## Optional | ||
| {{- $blogPosts := where .Site.RegularPages "Section" "blog" }} | ||
| {{- $recentPosts := first 20 (where $blogPosts ".Date" ">" (now.AddDate -1 0 0)) }} | ||
| {{- range $recentPosts }} | ||
| {{- if not (isset .Params "llms_exclude") }} | ||
| {{- if or (in .Title "Infrastructure as Code") (in .Title "Terraform") (in .Title "CloudFormation") (in .Title "AWS CDK") (in .Title "Kubernetes") (in .Title "Getting Started") }} | ||
| - [{{ .Title }}]({{ .Permalink }}){{ if .Params.meta_desc }} - {{ .Params.meta_desc | truncate 100 }}{{ end }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- end }} | ||
| - [Blog](https://www.pulumi.com/blog/) - Latest features, best practices, and announcements | ||
| - [Case Studies](https://www.pulumi.com/case-studies/) - How BMW, Mercedes-Benz, Snowflake use Pulumi | ||
| - [What Is Pulumi?](https://www.pulumi.com/what-is/what-is-pulumi/) - Detailed explanation | ||
| - [Community](https://www.pulumi.com/community/) - Slack, discussions, events | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| /** | ||
asafashirov marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * AI Bot Detection and Tracking for llms.txt experiment | ||
| * Tracks AI/LLM bot access to pulumi.com to measure llms.txt effectiveness | ||
| */ | ||
|
|
||
| (function() { | ||
| 'use strict'; | ||
|
|
||
| /** | ||
| * Detects if the current user agent is an AI/LLM bot (CLIENT-SIDE ONLY) | ||
| * Note: Most LLM bots fetch llms.txt server-side without executing JavaScript. | ||
| * This detection is supplemental to server-side bot tracking in access logs. | ||
| * Based on actual bot traffic data from pulumi.com analytics. | ||
| * @returns {boolean} true if AI bot detected | ||
| */ | ||
| function detectAIBot() { | ||
| const ua = navigator.userAgent.toLowerCase(); | ||
|
|
||
| // Known AI bot patterns from actual traffic data | ||
| const aiPatterns = [ | ||
| /claudebot\/\d+\.\d+/i, // ClaudeBot/1.0 | ||
| /amazonbot\/\d+\.\d+/i, // Amazonbot/0.1 | ||
| /chatgpt-user\/\d+\.\d+/i, // ChatGPT-User/1.0 | ||
| /oai-searchbot\/\d+\.\d+/i, // OAI-SearchBot/1.0, 1.3 | ||
| /perplexitybot\/\d+\.\d+/i, // PerplexityBot/1.0 | ||
| /gptbot/i, // GPTBot (general) | ||
| /anthropic/i, // Anthropic bots | ||
| /bingbot/i, // Bing (may use AI) | ||
| /baiduspider/i, // Baidu (has AI features) | ||
| /\bbot\b.*\/(ai|llm|gpt|claude)/i // Future-proofing pattern | ||
| ]; | ||
|
|
||
| return aiPatterns.some(pattern => pattern.test(ua)); | ||
| } | ||
|
|
||
| /** | ||
| * Sends tracking event to analytics | ||
| * @param {string} eventName - Name of the event | ||
| * @param {object} eventData - Additional event data | ||
| */ | ||
| function trackEvent(eventName, eventData) { | ||
| // Use Segment analytics if available | ||
| if (typeof window.analytics !== 'undefined' && window.analytics.track) { | ||
| window.analytics.track(eventName, eventData); | ||
| } | ||
|
|
||
| // Also send to Google Analytics if available | ||
| if (typeof gtag !== 'undefined') { | ||
| gtag('event', eventName, { | ||
| 'event_category': 'llms_txt', | ||
| ...eventData | ||
| }); | ||
| } | ||
|
|
||
| // Log to console in development | ||
| if (window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1') { | ||
| console.log('[AI Bot Tracking]', eventName, eventData); | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Initialize AI bot tracking | ||
| */ | ||
| function initAIBotTracking() { | ||
| // Check if current visitor is an AI bot | ||
| const isAIBot = detectAIBot(); | ||
|
|
||
| if (isAIBot) { | ||
| // Track AI bot page access | ||
| trackEvent('ai_bot_access', { | ||
| user_agent: navigator.userAgent, | ||
| page_path: window.location.pathname, | ||
| page_url: window.location.href, | ||
| referrer: document.referrer, | ||
| timestamp: new Date().toISOString() | ||
| }); | ||
|
|
||
| // Add data attribute to body for debugging | ||
| document.body.setAttribute('data-ai-bot', 'true'); | ||
| } | ||
|
|
||
| // Track llms.txt file access specifically | ||
| if (window.location.pathname === '/llms.txt') { | ||
| trackEvent('llms_txt_fetch', { | ||
| user_agent: navigator.userAgent, | ||
| is_ai_bot: isAIBot, | ||
| referrer: document.referrer, | ||
| timestamp: new Date().toISOString() | ||
| }); | ||
| } | ||
|
|
||
| // Track .md version requests (future enhancement) | ||
| if (window.location.pathname.endsWith('.md')) { | ||
| trackEvent('markdown_version_request', { | ||
| user_agent: navigator.userAgent, | ||
| is_ai_bot: isAIBot, | ||
| page_path: window.location.pathname, | ||
| referrer: document.referrer, | ||
| timestamp: new Date().toISOString() | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| // Wait for DOM and analytics to be ready | ||
| if (document.readyState === 'loading') { | ||
| document.addEventListener('DOMContentLoaded', initAIBotTracking); | ||
| } else { | ||
| // DOM already loaded, initialize immediately | ||
| // Give analytics libraries a moment to load | ||
| setTimeout(initAIBotTracking, 100); | ||
| } | ||
|
|
||
| // Export functions for testing/debugging | ||
| window.pulumiAITracking = { | ||
| detectAIBot: detectAIBot, | ||
| trackEvent: trackEvent, | ||
| initAIBotTracking: initAIBotTracking | ||
| }; | ||
| })(); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| # Pulumi | ||
|
|
||
| > Infrastructure as code using real programming languages. Write, test, and deploy cloud infrastructure with TypeScript, Python, Go, C#, or Java instead of YAML. Get IDE support, type safety, and automated testing for AWS, Azure, GCP, Kubernetes, and 150+ providers. | ||
|
|
||
| ## Getting Started | ||
|
|
||
| - [Installation](https://www.pulumi.com/docs/iac/get-started/install/) - Install Pulumi CLI and tools | ||
| - [AWS Quick Start](https://www.pulumi.com/docs/iac/get-started/aws/) - Deploy first AWS infrastructure | ||
| - [Azure Quick Start](https://www.pulumi.com/docs/iac/get-started/azure/) - Deploy first Azure infrastructure | ||
| - [GCP Quick Start](https://www.pulumi.com/docs/iac/get-started/gcp/) - Deploy first GCP infrastructure | ||
| - [Kubernetes Quick Start](https://www.pulumi.com/docs/iac/get-started/kubernetes/) - Deploy to Kubernetes | ||
| - [Core Concepts](https://www.pulumi.com/docs/iac/concepts/) - Projects, stacks, resources, and state | ||
|
|
||
| ## Infrastructure as Code (IaC) | ||
|
|
||
| - [Why Pulumi?](https://www.pulumi.com/docs/iac/) - Real code vs YAML configuration | ||
| - [Languages & SDKs](https://www.pulumi.com/docs/iac/languages-sdks/) - TypeScript, Python, Go, C#, Java, YAML | ||
| - [Cloud Providers](https://www.pulumi.com/docs/iac/clouds/) - AWS, Azure, GCP, Kubernetes guides | ||
| - [CLI Commands](https://www.pulumi.com/docs/iac/cli/commands/) - Complete command reference | ||
| - [Automation API](https://www.pulumi.com/docs/iac/automation-api/) - Embed Pulumi in your applications | ||
| - [CrossGuard Policies](https://www.pulumi.com/docs/iac/crossguard/) - Policy as code enforcement | ||
| - [Terraform Migration](https://www.pulumi.com/docs/iac/adopting-pulumi/migrate-terraform/) - Migrate from Terraform | ||
| - [CloudFormation Migration](https://www.pulumi.com/docs/iac/adopting-pulumi/migrate-cloudformation/) - Migrate from CloudFormation | ||
|
|
||
| ## Pulumi ESC (Environments, Secrets, Configuration) | ||
|
|
||
| - [Overview](https://www.pulumi.com/docs/esc/) - Centralized secrets and configuration management | ||
| - [Get Started](https://www.pulumi.com/docs/esc/get-started/) - Quick start guide | ||
| - [Environments](https://www.pulumi.com/docs/esc/environments/) - Define and manage environments | ||
| - [Integrations](https://www.pulumi.com/docs/esc/integrations/) - Integrate with external secret stores | ||
| - [CLI Reference](https://www.pulumi.com/docs/esc/cli/) - ESC command reference | ||
|
|
||
| ## Pulumi Cloud Platform | ||
|
|
||
| - [Overview](https://www.pulumi.com/docs/pulumi-cloud/) - Managed platform capabilities | ||
| - [Deployments](https://www.pulumi.com/docs/pulumi-cloud/deployments/) - Automated deployments | ||
| - [Pulumi Copilot](https://www.pulumi.com/docs/pulumi-cloud/copilot/) - AI-powered infrastructure | ||
| - [Access Management](https://www.pulumi.com/docs/pulumi-cloud/access-management/) - Teams, roles, RBAC | ||
| - [Audit Logs](https://www.pulumi.com/docs/pulumi-cloud/admin/audit-logs/) - Compliance and security | ||
| - [Pulumi Insights](https://www.pulumi.com/docs/insights/) - Infrastructure intelligence and search | ||
|
|
||
| ## Registry (Providers & Packages) | ||
|
|
||
| - [AWS Provider](https://www.pulumi.com/registry/packages/aws/) - Complete AWS resource coverage | ||
| - [Azure Native Provider](https://www.pulumi.com/registry/packages/azure-native/) - Full Azure ARM API | ||
| - [Google Cloud Provider](https://www.pulumi.com/registry/packages/gcp/) - Complete GCP coverage | ||
| - [Kubernetes Provider](https://www.pulumi.com/registry/packages/kubernetes/) - Native Kubernetes support | ||
| - [All Providers](https://www.pulumi.com/registry/) - 150+ cloud and SaaS providers | ||
|
|
||
| ## API Reference | ||
|
|
||
| - [Node.js/TypeScript](https://www.pulumi.com/docs/reference/pkg/nodejs/) - Complete TypeScript/JavaScript API | ||
| - [Python](https://www.pulumi.com/docs/reference/pkg/python/) - Complete Python API | ||
| - [Go](https://www.pulumi.com/docs/reference/pkg/go/) - Complete Go API | ||
| - [.NET/C#](https://www.pulumi.com/docs/reference/pkg/dotnet/) - Complete .NET API | ||
| - [Java](https://www.pulumi.com/docs/reference/pkg/java/) - Complete Java API | ||
|
|
||
| ## Tutorials & Examples | ||
|
|
||
| - [Tutorials](https://www.pulumi.com/tutorials/) - Hands-on learning paths | ||
| - [Examples](https://github.com/pulumi/examples) - Production-ready templates | ||
| - [Templates](https://www.pulumi.com/templates/) - Starter templates for common architectures | ||
|
|
||
| ## Optional | ||
asafashirov marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - [Blog](https://www.pulumi.com/blog/) - Latest features, best practices, and announcements | ||
| - [Case Studies](https://www.pulumi.com/case-studies/) - How BMW, Mercedes-Benz, Snowflake use Pulumi | ||
| - [What Is Pulumi?](https://www.pulumi.com/what-is/what-is-pulumi/) - Detailed explanation | ||
| - [Community](https://www.pulumi.com/community/) - Slack, discussions, events | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.