Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
repos:
# Rust formatting and linting
- repo: https://github.com/rust-lang/rust-clippy
rev: v1.81.0
hooks:
- id: clippy
args: ['--all-targets', '--all-features', '--', '-D', 'warnings']
stages: [pre-commit]

- repo: local
hooks:
- id: rust-fmt
name: rust-fmt
description: Format Rust code
entry: cargo fmt --
language: system
types: [rust]
stages: [pre-commit]
pass_filenames: false

- id: cargo-check
name: cargo-check
description: Check Rust code compiles
entry: cargo check --all
language: system
types: [rust]
stages: [pre-commit]
pass_filenames: false

# Python formatting and linting
- repo: https://github.com/psf/black
rev: 24.10.0
hooks:
- id: black
language_version: python3.9
stages: [pre-commit]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.2
hooks:
- id: ruff
args: [--fix]
stages: [pre-commit]
- id: ruff-format
stages: [pre-commit]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.14.1
hooks:
- id: mypy
additional_dependencies:
- types-all
files: ^llmkit-python/
stages: [pre-commit]
args: [--ignore-missing-imports]

# TypeScript/JavaScript formatting and linting using Biome
- repo: https://github.com/biomejs/pre-commit
rev: v1.8.3
hooks:
- id: biome-ci
name: biome-ci
description: Run Biome linter and formatter on TypeScript/JavaScript
stages: [pre-commit]
files: ^(llmkit-node/|examples/nodejs/)
exclude: |
(?x)^(
llmkit-node/index\.(js|d\.ts)|
llmkit-node/.*\.node$
)$

# General checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
stages: [pre-commit]
- id: end-of-file-fixer
stages: [pre-commit]
- id: check-yaml
stages: [pre-commit]
- id: check-toml
stages: [pre-commit]
- id: check-json
stages: [pre-commit]
- id: check-merge-conflict
stages: [pre-commit]
- id: mixed-line-ending
args: ['--fix=lf']
stages: [pre-commit]

# Spell checking
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
args: [--ignore-words-list=crate,nd,sav]
stages: [pre-commit]
205 changes: 90 additions & 115 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,131 +1,106 @@
# Changelog

All notable changes to LLMKit will be documented in this file.
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [0.1.2] - 2025-01-13
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The release date shows "2025-01-13" which appears to be a year in the past. Given that it's currently January 14, 2026, this should likely be "2026-01-13".

Suggested change
## [0.1.2] - 2025-01-13
## [0.1.2] - 2026-01-13

Copilot uses AI. Check for mistakes.

## [0.1.1] - 2026-01-12
### Added

#### Infrastructure & Developer Experience
- **Pre-commit hooks configuration** - Automated code quality checks for all three languages:
- Rust: `cargo fmt`, `cargo clippy`, `cargo check`
- Python: `black`, `ruff`, `mypy` with strict type checking
- TypeScript/JavaScript: Biome unified formatter and linter
- General: Trailing whitespace, line endings, YAML/TOML/JSON validation, spell checking
- **Biome configuration** - Unified TypeScript/JavaScript formatting and linting (single quotes, 2-space indent, 100-char line width)
- **Enhanced CONTRIBUTING.md** - Comprehensive guide for setting up pre-commit hooks, troubleshooting, and code quality standards

#### Documentation
- Pre-commit setup instructions for contributors
- Per-language code quality command examples
- Troubleshooting guide for common pre-commit issues
- Updated PR checklist to include code quality verification

### Fixed

- **Package Names**: Corrected installation instructions in READMEs
- Python: `pip install llmkit-python` (was incorrectly `llmkit`)
- Node.js: `npm install llmkit-node` (was incorrectly `llmkit`)
- **Badge URLs**: Fixed PyPI and npm badge links in main README
- **Model Registry**: Regenerated from latest crawler data (97 providers, 11,067 models)
- Updated pricing, capabilities, and benchmark data
- Synchronized with latest provider API changes
#### Test Assertions (46 panic improvements across 30 provider files)
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The count of panic improvements appears inconsistent. Based on the diffs in this PR, there are 52 panic message improvements across 29 files, but the CHANGELOG states "46 panic improvements across 30 provider files". Please verify and update the counts to match the actual changes.

Copilot uses AI. Check for mistakes.
- **Core providers (5 files, 10 panics fixed)**:
- `ollama.rs`: 2 panics - Text content and tool use assertions
- `anthropic.rs`: 2 panics - Simple and structured system content validation
- `openai.rs`: 3 panics - JsonObject and JsonSchema response format validation
- `groq.rs`: 1 panic - Tool use content validation
- `ai21.rs`: 2 panics - Text and tool use content blocks

- **Major providers (18 files, 31 panics fixed)**:
- `cohere.rs`: 2 panics - Text and tool use content blocks
- `huggingface.rs`: 2 panics - Text and tool use content blocks
- `mistral.rs`: 2 panics - Tool use and text content
- `replicate.rs`: 2 panics - Text content assertions
- Single panic fixes in: `aleph_alpha.rs`, `nlp_cloud.rs`, `yandex.rs`, `clova.rs`, `writer.rs`, `maritaca.rs`, `watsonx.rs`, `cerebras.rs`, `cloudflare.rs`, `sambanova.rs`, `databricks.rs`, `fireworks.rs`, `openrouter.rs`, `azure.rs`

- **Advanced providers (2 files, 5 panics fixed)**:
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The panic count for "Advanced providers" is incorrect. The section states "2 files, 5 panics fixed" but lists deepseek.rs with 5 panics and openai_compatible.rs with 2 panics, which totals 7 panics, not 5.

Suggested change
- **Advanced providers (2 files, 5 panics fixed)**:
- **Advanced providers (2 files, 7 panics fixed)**:

Copilot uses AI. Check for mistakes.
- `deepseek.rs`: 5 panics - Text content blocks and thinking content blocks
- `openai_compatible.rs`: 2 panics - Text and tool use content blocks

- **Special APIs & Utilities (2 files, 5 panics fixed)**:
- `runpod.rs`: 4 panics - Text content block assertions
- `baseten.rs`: 4 panics - Text content block assertions
- `openai_realtime.rs`: 3 panics - SessionCreated, Error, RateLimitUpdated validation
- `streaming_multiplexer.rs`: 2 panics - Text delta and chunk reception
Comment on lines +48 to +52
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The "Special APIs & Utilities" section has inconsistencies: it states "2 files, 5 panics fixed" but then lists 4 files (runpod.rs with 4 panics, baseten.rs with 4 panics, openai_realtime.rs with 3 panics, and streaming_multiplexer.rs with 2 panics). This totals 4 files with 13 panics, not 2 files with 5 panics.

Copilot uses AI. Check for mistakes.

### Documentation
**Improvement**: All test panics now display actual values received when assertions fail, providing better debugging information instead of generic error messages. Pattern applied consistently: `panic!("Expected X, got {:?}", other)`

- Enhanced READMEs with "Why LLMKit?" section highlighting Rust benefits
- Added production features overview (smart router, circuit breaker, guardrails)
- Improved code examples for prompt caching, extended thinking, and model registry
- Cleaned up internal development notes from documentation
- Simplified PROVIDERS.md and MODELS_REGISTRY.md for better readability
### Changed

## [0.1.0] - 2026-01-11
- Version bumped to 0.1.2 across Rust, Python, and TypeScript packages
- All test assertions now follow consistent panic message patterns for improved debuggability
- Enhanced code quality standards with automated enforcement via pre-commit

### Technical Details

- **Panic pattern standardization**: Converted `if let ... else panic!("message")` to `match` statements with debug output
- **Pre-commit stages**: All checks configured for `pre-commit` stage (runs before commit)
- **Language-specific scoping**: TypeScript checks only run on `llmkit-node/` and `examples/nodejs/`
- **Biome configuration**:
- Formatter: 2-space indent, 100-char line width, single quotes
- Linter: Recommended rules enabled with correctness and style emphasis

## [0.1.1] - 2025-01-12
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The date for version 0.1.1 shows "2025-01-12" which is in the past relative to the current release 0.1.2 dated "2025-01-13". However, given that it's currently January 14, 2026, this date appears to be from a year ago. Please verify these dates are correct - they should likely be "2026-01-12" and "2026-01-13" respectively.

Copilot uses AI. Check for mistakes.

### Added

Initial release of LLMKit.
- Initial stable release with 100+ LLM provider support
- Rust core implementation with trait-based architecture
- Python bindings via Maturin (PyO3)
- TypeScript/Node.js bindings via NAPI-RS
- Support for multiple AI capabilities:
- Text completion and streaming
- Tool/function calling
- Vision/image input
- Audio synthesis and processing
- Image generation
- Video generation
- Embeddings
- Specialized APIs (OpenAI Realtime, etc.)
- Comprehensive feature set:
- Request multiplexing
- Circuit breaker pattern
- Failover handling
- Health checks
- Metering and observability
- Rate limiting and retry logic
- Smart provider routing
- Multi-tenancy support
- Complete documentation and examples for all three languages

## [0.1.0] - 2025-01-10
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The date for version 0.1.0 shows "2025-01-10" which appears to be a year in the past. Given that it's currently January 14, 2026, this should likely be "2026-01-10".

Copilot uses AI. Check for mistakes.

### Added

#### Core Features
- Unified LLM API interface with **100+ providers**
- **11,000+ model registry** with pricing, capabilities, and benchmarks
- Streaming completions with async iterators
- Tool/function calling with fluent builder pattern (`ToolBuilder`)
- Structured output with JSON schema enforcement
- Vision/image input support (base64 and URLs)
- Comprehensive error types for all failure modes
- Feature flags for provider selection

#### Extended Thinking
- Unified `ThinkingConfig` API across 4 providers:
- OpenAI (o3, o1-pro)
- Anthropic (Claude with extended thinking)
- Google Vertex AI (Gemini 2.0 Deep Thinking)
- DeepSeek (DeepSeek-R1)

#### Prompt Caching
- Native support for Anthropic, OpenAI, Google, and DeepSeek
- 5-minute and 1-hour TTL options
- Up to 90% cost savings on repeated prompts

#### Regional Providers
- Mistral EU with GDPR-compliant endpoint
- Maritaca AI for Brazilian Portuguese
- Regional configuration via environment variables

#### Audio & Voice
- Deepgram v3 with Nova-3 models
- ElevenLabs with configurable latency modes
- Speech-to-text and text-to-speech support

#### Video Generation
- Runware aggregator supporting 5+ video models
- Runway Gen-4.5, Kling 2.0, Pika 1.0, and more

#### Embeddings & Specialized
- Voyage AI embeddings
- Jina AI embeddings and reranking
- Token counting API
- Batch processing API

#### Providers
- **Core**: Anthropic, OpenAI, Azure OpenAI
- **Cloud**: AWS Bedrock, Google Vertex AI, Google AI
- **Fast Inference**: Groq, Mistral, Cerebras, SambaNova, Fireworks, DeepSeek
- **Enterprise**: Cohere, AI21
- **Hosted**: Together, Perplexity, DeepInfra, OpenRouter
- **Local**: Ollama, LM Studio, vLLM, TGI, Llamafile
- **Regional**: YandexGPT, GigaChat, Clova, Maritaca
- **Specialized**: Voyage, Jina, Deepgram, ElevenLabs, Fal

#### Python Bindings
- Synchronous `LLMKitClient` and async `AsyncLLMKitClient`
- Full streaming support with iterators
- Type stubs for IDE completion
- Complete feature parity with Rust core

#### Node.js/TypeScript Bindings
- `LLMKitClient` with async/await API
- Streaming via async iterator and callbacks
- Full TypeScript type definitions
- Complete feature parity with Rust core

### Security
- No unsafe code in core library
- API keys not logged
- HTTPS enforced for all providers

### Testing
- 186+ tests (Rust, Python, Node.js)
- Unit, integration, and mock test coverage

### Documentation
- Getting Started guides for Rust, Python, and Node.js
- API reference documentation
- Provider configuration guide
- 27+ example files

---

## Future Plans

### [0.2.0] - Planned

- Provider pooling and load balancing
- Automatic failover between providers
- Health checking for provider availability
- Cost metering and budget controls
- Guardrails integration

---

[Unreleased]: https://github.com/yfedoseev/llmkit/compare/v0.1.1...HEAD
[0.1.1]: https://github.com/yfedoseev/llmkit/compare/v0.1.0...v0.1.1
[0.1.0]: https://github.com/yfedoseev/llmkit/releases/tag/v0.1.0
- Initial development release
- Core architecture and provider framework
- Basic functionality for major providers (OpenAI, Anthropic, etc.)
- Foundation for Python and TypeScript bindings
Loading