• v1.0.3 26df641ccd

    v1.0.3 Stable

    kerem released this 2025-12-16 21:46:22 +03:00 | 168 commits to main since this release

    📅 Originally published on GitHub: Tue, 16 Dec 2025 18:49:32 GMT
    🏷️ Git tag created: Tue, 16 Dec 2025 18:46:22 GMT

    Introduces accurate token counting for usage tracking and improves compatibility.

    New Features

    Added: Token counting with tiktoken for accurate usage tracking (#4)

    • New tokenizer.py module using OpenAI's tiktoken library (Rust-based, blazing fast)
    • Proper separation of prompt_tokens and completion_tokens in API responses
    • Claude correction factor (1.15x) for more accurate token estimation
    • Supports messages, tools, and multimodal content token counting
    • Graceful fallback to character-based estimation if tiktoken unavailable

    🐛 Bug Fixes

    Fixed: Structured JSON error responses from Kiro API

    • Error responses now return proper OpenAI-compatible JSON format instead of raw text
    • Includes error message, type, and status code for better debugging

    Fixed: Windows path compatibility for KIRO_CREDS_FILE

    • Paths with backslashes (e.g., D:\Projects\file.json) no longer break due to escape sequence processing
    • Added raw .env file reading to preserve Windows paths as-is

    Fixed: Cross-platform path normalization

    • KIRO_CREDS_FILE paths are now normalized for Windows/Linux/macOS compatibility

    Improvements

    Changed: Reduced default FIRST_TOKEN_TIMEOUT from 30s to 15s

    • Faster detection of stuck requests
    • More responsive retry behavior

    Changed: Centralized version constant

    • Version is now defined in single place (config.py) and imported elsewhere
    • Follows Single Source of Truth principle

    ⚙️ Configuration

    Updated default values:

    Variable Old Default New Default
    FIRST_TOKEN_TIMEOUT 30 15

    📦 Dependencies

    • Added tiktoken to requirements.txt for token counting

    🔄 Upgrade

    After downloading and extracting the new release, install new dependencies from the project folder:

    pip install -r requirements.txt
    

    Full Changelog: https://github.com/jwadow/kiro-openai-gateway/compare/v1.0.2...v1.0.3

    Downloads