Skip to content

Contributing to liter-llm

Thank you for your interest in contributing to liter-llm! This guide will help you get started with development.

This project uses mise for its toolchain and task automation. mise.toml pins every tool version, and mise run <task> runs the repository tasks with those tools on PATH.

Install mise by following the official getting-started guide, then trust the repository configuration once:

Terminal window
mise trust

After installing mise, set up your development environment:

Terminal window
# One-time setup - installs all dependencies
mise run setup
# Build the core Rust library
mise run build

The setup command will install Rust, Python, Node.js, Go, Java, and Elixir tooling as needed.

Terminal window
# Build all crates
mise run build
Terminal window
# Run all tests
mise run test
# Run all checks (lint + test)
mise run check
Terminal window
# Format all code
mise run format
# Run all linters via prek
mise run lint
# Generate READMEs from templates
alef readme
Terminal window
# Update all dependencies
mise run update
# Clean all build artifacts
mise run clean

Each language binding has its own namespace. Format and lint every language with the root mise run format and mise run lint.

Rust:

Terminal window
mise run rust:build
mise run rust:test
mise run rust:format
mise run rust:lint:check

Node.js:

Terminal window
mise run node:build # Build NAPI-RS native module (release)
mise run node:build:dev # Build in debug mode
mise run node:test

Elixir:

Terminal window
mise run elixir:build # Compile (includes Rustler NIF)

Ruby:

Terminal window
mise run ruby:test # Run Ruby tests (after `bundle exec rake compile` in packages/ruby)

PHP:

Terminal window
mise run php:build # Build the PHP extension
mise run php:test # Smoke-test the built extension

WebAssembly:

Terminal window
mise run wasm:build web # Build WASM package (web, bundler or nodejs target)
mise run wasm:build:node # Build WASM package (Node.js target)
mise run wasm:test:wasm32 # Run the wasm32 tests in Node.js

The c, csharp, elixir, go, java, node, php, python, ruby, rust and wasm bindings have mise run <lang>:e2e:test, for example mise run c:e2e:test; run the others with alef test --lang <lang> --e2e.

  1. Add a provider entry to schemas/providers.json:

    {
    "my-provider": {
    "base_url": "https://api.myprovider.com/v1",
    "auth_header": "Authorization",
    "auth_prefix": "Bearer",
    "model_prefixes": ["my-provider/"],
    "parameter_mappings": {}
    }
    }

    Fields:

    • base_url (required): Provider API base URL
    • auth_header (required): Header name for authentication
    • auth_prefix (optional): Prefix for the auth value (e.g. “Bearer”)
    • model_prefixes (required): Model name prefixes that route to this provider
    • parameter_mappings (optional): Map OpenAI parameter names to provider-specific names
  2. Build and test

    Terminal window
    mise run build
    mise run test
  3. Regenerate E2E tests

    Terminal window
    mise run e2e:generate
    mise run test

E2E tests are generated from JSON fixtures in tools/e2e-generator/fixtures/ and produce runnable test suites for each language binding.

Terminal window
# Generate E2E tests for all languages
mise run e2e:generate
# Run Rust E2E tests
mise run rust:e2e:test

Generated test files in e2e/ should not be edited directly – modify fixtures or the generator source instead.

Terminal window
# Show all available tasks
mise tasks
# Show all tasks including hidden ones
mise tasks --hidden

The project uses prek for pre-commit hooks:

Terminal window
# Install hooks
prek install
prek install --hook-type commit-msg
# Run all hooks manually
prek run --all-files

We use conventional commits:

  • feat: add support for new-provider
  • fix: correct auth header injection
  • docs: update installation instructions
  • chore: update dependencies
  • test: add tests for streaming
  1. Create a feature branch

    Terminal window
    git checkout -b feat/add-provider-support
  2. Make your changes and run checks locally:

    Terminal window
    mise run check
  3. Commit and push

    Terminal window
    git commit -m "feat: add support for new provider"
    git push origin feat/add-provider-support
  4. Create a Pull Request – link any related issues and ensure CI passes.

Version is managed in Cargo.toml workspace and synced across all manifests:

Terminal window
mise run version:sync