llm-ls  by huggingface

LSP server for LLM-powered code completion

created 2 years ago
802 stars

Top 44.9% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides an LLM-powered Language Server Protocol (LSP) server designed to enhance code completion and development workflows. It targets developers seeking intelligent, context-aware code suggestions within their IDEs, abstracting the complexities of LLM interaction for IDE extension developers.

How It Works

llm-ls acts as a central hub for LLM-driven code intelligence. It leverages the current file's content to construct context-aware prompts, supporting "fill-in-the-middle" capabilities and managing tokenization to respect model context windows. The server parses code Abstract Syntax Trees (ASTs) to intelligently determine the type of completion needed (single-line, multi-line, or none).

Quick Start & Requirements

  • Install: pip install llm-ls
  • Prerequisites: Python 3.8+, compatible LLM backend (Hugging Face Inference API, text-generation-inference, ollama, OpenAI-compatible APIs).
  • Docs: https://github.com/huggingface/llm-ls

Highlighted Details

  • Supports multiple LLM backends including Hugging Face Inference API, TGI, Ollama, and OpenAI-compatible APIs.
  • AST parsing for intelligent completion type determination.
  • Context window management via tokenization.
  • Telemetry for potential model retraining (data stored locally).

Maintenance & Community

  • Actively developed by Hugging Face.
  • Roadmap includes multi-file context, prompt tuning, and filtering bad suggestions.

Licensing & Compatibility

  • License: Apache 2.0.
  • Compatible with commercial use and closed-source linking.

Limitations & Caveats

This project is explicitly marked as a work in progress, with the potential for broken functionality. Support for Jupyter integration is currently missing.

Health Check
Last commit

1 month ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
0
Star History
42 stars in the last 90 days

Explore Similar Projects

Starred by Tobi Lutke Tobi Lutke(Cofounder of Shopify), Stas Bekman Stas Bekman(Author of Machine Learning Engineering Open Book; Research Engineer at Snowflake), and
21 more.

guidance by guidance-ai

0.1%
21k
Guidance is a programming paradigm for steering LLMs
created 2 years ago
updated 1 day ago
Feedback? Help us improve.