Close

Summary

Learn how to build accessible websites using local open-source AI coding tools. This guide introduces tools like Bolt.diy, Roo Cline, and Aider, which enhance web development with AI-powered code generation, debugging, and accessibility checks. Improve your workflow with privacy-first and efficient development tools.

Creating accessible websites is no longer just a nice-to-have; it’s an essential practice to ensure digital equity for all users, including those with disabilities. Next Generation Internet (NGI) projects are leading the charge in this mission by leveraging the power of free and open-source local Large Language Models (LLMs) combined with coding tools like Bolt.diy. In this article, we’ll explore what these technologies are, how they can be used, and how they can help you create more inclusive web experiences.

ollama logo

What Are Local Open-Source LLMs?

Local open-source LLMs are advanced AI models trained to understand and generate human-like text. Unlike cloud-based solutions, these models run locally on your own infrastructure, ensuring data privacy and giving you full control over their functionality. Open-source options allow developers to customize the model’s behavior to suit specific project needs without incurring licensing fees.

Local LLMs can be a game-changer for NGI projects, as they align with the principles of openness, transparency, and decentralization. Newer models such as DeepSeek R1, Qwen Coder, and Phi 4—as well as others available on Ollama’s platform—offer cutting-edge performance for generating accessible web code.

bolt.diy: AI-Powered Full-Stack Web Development in the Browser

Introducing bolt.diy : Simplifying Web Development (FREE)

Bolt.diy is a lightweight and open-source coding tool designed to assist developers in rapidly prototyping and building web solutions. It integrates seamlessly with LLMs, offering:

GitHub Repository: stackblitz-labs/bolt.diy

  • Real-time code suggestions: Generate boilerplate code or complex components quickly.

  • Debugging assistance: Identify and fix accessibility issues in your code.

  • Interactive collaboration: Work on projects with your team in a streamlined environment.

By pairing Bolt.diy with a local LLM, you can harness AI to make accessibility a built-in feature of your workflow, rather than an afterthought.

Roo Cline: Free and Feature-Rich Alternative to Costly AI Coding Tools | by Manpreet Singh | Jan, 2025 | AI Advances

Introducing a more advanced IDE (Integrated Development Environment):  Roo-Cline 

Coding assistant for Visual Studio Code, and available in the Visual Studio Store.
A Privacy-First Coding Assistant with Integrated Accessibility Checks. (Roo-Cline is a Cline Fork)

GitHub Repository: RooVetGit/Roo-Cline

  • Real-time Accessibility Checks: Provides instant feedback to ensure WCAG compliance.
  • Privacy-Preserving: Processes data locally, safeguarding sensitive information.
  • Extensible: Open-source framework allows for customizations tailored to your needs.

Introducing Aider : a command-line-based AI coding assistant by seamlessly integrating with Git workflows

GitHub Repository: paul-gauthier/aider

  • Automate Code Refactoring: Use AI to suggest and implement improvements in your codebase.
  • Seamless Git Integration: Keep your development workflow smooth with AI-assisted commits and code reviews.
  • Multi-Language Support: Works with Python, JavaScript, and more, providing valuable insights and assistance.

Aider helps teams maintain clean, efficient, and well-structured code while leveraging AI to accelerate development cycles.

Guide_Coding_with_local_LLM

GUIDE: How to Use Local LLMs and Bolt.diy for Accessible Coding

1. Set Up Your Environment

Skills needed: basic linux knowledge, docker

  • Download & Install the Ollama software on your PC, Mac or Linux machine.

  • Download the Large Language Model.
    You can for example use the new DeepSeek R1, Qwen Coder, Phi 4, or others available on Ollama

    Beware: you need a beefy videocard or Macbook M with at least the same video memory (GB) as the modelsize!

    For testing out different models (online) go to: web.lmarena.ai

  • Download and configure Bolt.diy using the git instructions, on your development machine.

2. Generate Accessible Code

LLMs can be instructed to prioritize accessibility. When generating code for your website, you can provide prompts like:

“Create an accessible navigation menu with keyboard and screen reader support. Include ARIA roles and focus management.”

For example, the LLM might output:

<nav aria-label="Main Navigation">
  <ul>
    <li><a href="#home" tabindex="0">Home</a></li>
    <li><a href="#about" tabindex="0">About</a></li>
    <li><a href="#contact" tabindex="0">Contact</a></li>
  </ul>
</nav>
<script>
  document.querySelectorAll('a').forEach(link => {
    link.addEventListener('keydown', event => {
      if (event.key === 'Enter') {
        event.target.click();
      }
    });
  });
</script>

3. Use Bolt.diy for Validation

Once the LLM generates the code, use Bolt.diy’s built-in validation tools to:

  • Check for missing ARIA attributes.

  • Ensure color contrast ratios meet WCAG standards.

  • Verify that all interactive elements are keyboard-navigable.

4. Test and Iterate

Test your website with accessibility tools such as screen readers (e.g., NVDA or Apple VoiceOver) and keyboard navigation to ensure a seamless experience for all users. Refine the code as needed using insights from these tests.

The Role of Instruction in Accessibility

Effective use of LLMs for accessibility hinges on clear and detailed prompts. Here are a few examples of instructions you can use:

  • For semantic HTML: “Write an accessible form with proper labels, error messages, and keyboard focus handling.”

  • For ARIA usage: “Generate a modal dialog with ARIA roles and ensure it traps focus while open.”

  • For responsive design: “Create a mobile-friendly, accessible image gallery with captions and keyboard navigation.”

By providing precise and context-aware instructions, you can guide the LLM to produce code that adheres to accessibility standards.

Prompts for accessible code

To enhance the accessibility of your website, especially for screen reader users, it’s crucial to provide clear instructions to your Local Large Language Models (LLMs) for generating accessible code. Here are some prompt examples you can use:

    1. Accessible Forms:

      • Prompt: “Generate a contact form that is accessible to screen readers, including appropriate labels, fieldsets, and error messages.”
      • Expected Output: The LLM should produce a form with <label> elements correctly associated with their corresponding <input> fields using the for attribute, utilize <fieldset> and <legend> for grouping related fields, and provide clear, accessible error messages.
    2. ARIA Landmarks:

      • Prompt: “Create a webpage structure using ARIA landmarks to improve navigation for screen reader users.”
      • Expected Output: The LLM should generate a layout that includes ARIA landmark roles such as banner, navigation, main, and contentinfo to define different sections of the page, enhancing navigability for assistive technologies.
    3. Accessible Tables:

      • Prompt: “Construct a data table that is accessible, including table headers and captions.”
      • Expected Output: The LLM should create a <table> with <thead>, <tbody>, and <tfoot> sections, use <th> elements with appropriate scope attributes for headers, and include a <caption> to describe the table’s content.
    4. Skip Navigation Link:

      • Prompt: “Implement a ‘Skip to main content’ link to enhance keyboard navigation.”
      • Expected Output: The LLM should provide a link at the top of the page that allows users to bypass repetitive navigation links, directing them straight to the main content area.
    5. Accessible Images:

      • Prompt: “Insert images with appropriate alt text for screen reader accessibility.”
      • Expected Output: The LLM should generate <img> tags that include descriptive alt attributes, conveying the content and function of each image to users who rely on screen readers.

Key Resources for Accessibility Standards and Tools:

By incorporating these prompts and utilizing the resources above, you can guide your LLMs to generate code that adheres to accessibility best practices, ensuring a more inclusive experience for all users.

Wrap up

With the latest local open-source LLMs like DeepSeek R1, Qwen Coder, and Phi 4, along with powerful tools like Bolt.diy, building accessible websites is more achievable than ever. These technologies allow developers to integrate accessibility directly into their coding workflows while maintaining full control over data privacy and customization. By leveraging these tools within your NGI projects, you can take an active role in creating a more inclusive internet—one line of accessible code at a time.

Leave a Reply