Commit Graph
2 Commits
Author SHA1 Message Date
Arun Babu Neelicattu d6cdb9de0b feat(telemetry): add unified OTLP telemetry with OpenInference and OpenTelemetry GenAI support (#2330)
* feat(telemetry): add unified OTLP telemetry

Introduce a unified, lightweight, zero-dependency telemetry layer to
replace the legacy openinference namespace. Group OTLP transport
options under a nested otlp object, and replace the format string
with a semantics list (allowing multiple active tracing conventions).

This implementation:
1. Allows users to specify semantics: [openinference, otel_genai].
2. Collects and compiles trace attributes for OpenInference and
   OpenTelemetry GenAI in a single pass when both are active.
3. Integrates queue capacity, retry/backoff, and batch exporting.
4. Refactors code structure, C++ config unit tests, python integration
   tests, CLI commands, and markdown documentation.

* build: globally define NOMINMAX on Windows in CMake
2026-06-28 19:15:05 +00:00
8a23600046 Automatically determine context size (#2235)
* add auto context size

* do not assume positive ctx_length

* address review comments

* document ctx_size -1 behavior

* move autotune after model eviction

* Migrate config schema

* fix migration code

* Fix macOS auto-tune memory detection (unified memory) (#2257)

* Fix macOS auto-tune memory detection (unified memory)

On Apple Silicon, auto-tune resolved every model's context to the 4096
fallback because get_available_memory_gb() could not detect RAM, even
though system-info and the model-list RAM filter reported it correctly.

Two macOS-specific gaps caused this:

1. auto-tune only consulted the AMD/NVIDIA device accessors, which are
   stubs on macOS, so it fell through to "memory undetectable" → 4096.
   Add a get_apple_silicon_device() accessor (base class default is
   "unavailable", overridden in MacOSSystemInfo) that reports the unified
   memory pool: vram_gb = Metal recommendedMaxWorkingSetSize (GPU budget),
   virtual_gb = total hw.memsize. auto-tune's Metal branch now uses
   min(GPU budget, free unified RAM); the CPU/NPU branch uses unified RAM.

2. get_memory_usage_gb() returned *total* RAM instead of *used*, so
   available = total - used = 0. Implement real used-memory via mach
   host_statistics64 (active + wired + compressed pages), matching the
   used-memory semantics already used on Windows/Linux. This also fixes
   the /stats memory_gb field and the Prometheus lemonade_memory_used_gb
   gauge, which both expect used memory.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* Fix Mach port leak in macOS memory usage sampling

mach_host_self() returns a send right that must be deallocated after
use. Add mach_port_deallocate() on all exit paths so the right is
released on every call to get_memory_usage_gb().

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>

* fix test_026: explicitly load tool-calling model with 8k context

Auto-tune resolves ctx_size to ~3072 on the macOS CI runner, which is
too small for the Anthropic tool-calling prompt. Load the model with
an explicit 8192 ctx_size before the API call.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

---------

Co-authored-by: Mario Limonciello (AMD) <[email protected]>
Co-authored-by: Jeremy Fowers <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: jeremyfowers <[email protected]>
2026-06-16 04:52:11 +00:00