Skip to content

0.2.16

Choose a tag to compare

@github-actions github-actions released this 31 Aug 06:03
· 34 commits to main since this release

Changes since the last Release

Fixed

  • chunk_by_sentences never terminated when the chunk window was too small to carry an overlap. After emitting a packed chunk the loop walks back from the packed range to find the smallest tail worth overlap_tokens, then restarts the next pack there. When only one sentence fits at a time -- the next one pushes the window over chunk_tokens -- that walk-back always lands on first, the sentence the chunk just started with, so the identical singleton was emitted forever while the output vector grew without bound. Two 6-token sentences with chunk_tokens = 10 and any positive overlap is the minimal reproduction. The guard now requires strict forward progress (back > first), dropping the overlap for that one chunk rather than looping; a window that cannot hold two sentences cannot carry an overlap between them either. Reachable remotely: POST /v1/vector_stores/:name/files chunks with the collection's stored window, so a collection created with a small chunk_tokens hung the request thread and exhausted memory.

  • The WAV parser sized an allocation from an unvalidated chunk header. parse_wav_stream read the 32-bit chunk_size off the wire and called pcm_bytes.resize(chunk_size) before checking that the declared bytes were present, so a ~50-byte multipart upload declaring a 4 GiB data chunk forced the allocation -- std::bad_alloc or the OOM killer, depending on the box, and on chimera serve that takes the whole server down rather than one request. The parser now measures the stream once up front and rejects any chunk claiming more than what remains, and a short read on data is an error rather than a silently zero-filled tail. Rejecting rather than clamping is deliberate: a truncated buffer of zeroes transcribes as plausible silence, which is a worse failure than a 4xx.

  • The text-only chat path prepended a second BOS. The comment above the call says chat templates emit <|begin_of_text|> themselves and that add_special must therefore be false -- the multimodal path two branches up passes false for exactly this reason -- but the text path passed true. chimera tokenize shows the result directly: a Llama-3 templated prompt came back with 128000 <|begin_of_text|> twice. Llama-3 reacts by emitting a stray <|start_header_id|>assistant<|end_header_id|> and losing track of the user turn. Now false, matching both the comment and the mtmd path.

  • RAG ingestion was neither atomic nor safely retryable. Each chunk was inserted in its own transaction, so a failed embed or insert partway through one request left the leading chunks committed while the caller saw an error -- and since nothing keys on source_uri, retrying the same file duplicated everything that had already landed. One file (CLI) / one request (HTTP) is now one transaction. insert_document moved from BEGIN/COMMIT to a savepoint so it nests inside the caller's rather than failing with "cannot start a transaction within a transaction", and the new chimera_vector_store::Transaction is an RAII savepoint that rolls back unless commit() ran.

  • Row iteration reported a failed query as a short result. search_semantic looped while (sqlite3_step(...) == SQLITE_ROW) and returned whatever it had collected, so SQLITE_BUSY, SQLITE_IOERR or SQLITE_CORRUPT mid-iteration surfaced as a valid partial answer -- and in a hybrid search, as the whole semantic leg silently vanishing. The sibling search_lexical_raw already checked its terminal status; that pattern is now applied to search_semantic, list (collections), list_chats, load_messages and list_tables. find (collection by name) had the same shape in a different guise: it treated every non-SQLITE_ROW status as "no such collection", so a database error was reported as a missing row; it now distinguishes SQLITE_DONE from a genuine failure.

  • Persisted media paths were interpolated into JSON rather than serialized. Interactive chat built media_json by concatenating paths between quote characters, so any path containing a quote, a backslash (i.e. every Windows path) or a control character produced a body no JSON reader accepts -- losing the metadata the column exists to carry. It now builds a nlohmann::json array and dumps it.

  • response_format values outside the documented set were silently accepted. Anything that was not text, srt, vtt or verbose_json fell through to the default {"text": ...} body with HTTP 200, so a client that typo'd srt had no way to notice. Unsupported values now return 400 naming the accepted set.

Added

  • Application-level request limits on the audio, image and RAG routes. The staged cpp-httplib already carries a 256 MB per-request payload cap (_patch_server_http_payload_cap), but that is a floor rather than a policy: 256 MB of WAV still decodes to gigabytes of float samples, and the expensive parameters -- image batch count, image dimensions -- are small numbers in a small body that no payload cap can bound. Each route now checks its own bound before committing memory or the model worker: audio upload size (CHIMERA_MAX_AUDIO_BYTES, 256 MB), image n (CHIMERA_MAX_IMAGE_BATCH, 16) and per-side dimensions (CHIMERA_MAX_IMAGE_DIM, 4096), and RAG document size (CHIMERA_MAX_RAG_TEXT_BYTES, 64 MB) plus chunk count (CHIMERA_MAX_RAG_CHUNKS, 100k -- chunk count follows the collection's window, not the request, so the byte cap does not bound it). All are -D-overridable at configure time and set far above any legitimate use; the point is that the pathological case fails fast with a 4xx instead of occupying the single-threaded sd or whisper worker indefinitely.

  • A startup warning when the server is reachable off-host with no --api-key. Upstream's middleware_validate_api_key gates every route except /health and the UI assets -- chimera's own routes included -- so POST /v1/chimera/shutdown and the /v1/chats history endpoints are protected whenever a key is configured. But it is opt-in, and with no key anyone who can reach the port can stop the process, or read prompts, reasoning and chat contents by walking /v1/chats/:id (ids are sequential rowids, authorized by existence alone). That is a defensible default on loopback and a bad surprise off it, so binding to a non-loopback address without a key now says so once on stderr instead of leaving it to the docs.

  • Regression tests for the three defects the suite could not have caught. An over-declared WAV data chunk and an unknown response_format are driven through POST /v1/audio/transcriptions (the server surviving the first is half the assertion); the chunker case ingests 6-token sentences into a collection with a 10-token window and a positive overlap, where the timeout is the assertion -- before the fix that ingest never returned.