tumix

command module
v0.0.0-...-f97c3c1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2025 License: Apache-2.0 Imports: 42 Imported by: 0

README

tumix

tumix implements a TUMIX: Multi-Agent Test-Time Scaling with Tool-Use Mixture in Go.

Tracing

HTTP client tracing is off by default to minimize overhead. Set TUMIX_HTTP_TRACE=1 to enable OpenTelemetry spans for outgoing LLM HTTP calls; clients will keep using the shared pooled transport either way.

CLI flags (snapshot)

  • -model (default gemini-2.5-flash)
  • -max_rounds (default 3; higher improves quality, raises cost)
  • -temperature / -top_p / -top_k / -max_tokens / -seed
  • -json (emit final answer as JSON on stdout)
  • -session_dir (persist sessions to disk; default in-memory)
  • TUMIX_SESSION_SQLITE env to use sqlite-backed store instead of session_dir
  • -batch_file with -concurrency (one prompt per line)
  • -http_trace (enable HTTP spans)
  • -otlp_endpoint (export traces)
  • -bench_local to run synthetic local benchmark (no LLM calls)
  • -max_prompt_chars to fail fast on oversized prompts
  • -max_prompt_tokens tokenizer-backed guard (CountTokens) with heuristic fallback; pricing override via TUMIX_PRICING_FILE
  • -metrics_addr serve /healthz, /debug/vars, /metrics (Prometheus text)

Env overrides: GOOGLE_API_KEY, TUMIX_MODEL, TUMIX_MAX_ROUNDS, TUMIX_TEMPERATURE, TUMIX_TOP_P, TUMIX_TOP_K, TUMIX_MAX_TOKENS, TUMIX_SESSION_DIR, TUMIX_HTTP_TRACE, TUMIX_CALL_WARN, TUMIX_CONCURRENCY.

Quick recipes

  • Low cost: ./tumix -model gemini-2.5-flash -max_rounds 2 -temperature 0.2 "Explain X"
  • High quality: ./tumix -model gemini-2.5-pro -max_rounds 3 -top_p 0.95 -max_tokens 512 "Explain Y"
  • Batch: ./tumix -batch_file prompts.txt -concurrency 4 -json
  • Persist & observe: TUMIX_SESSION_SQLITE=/tmp/tumix.db ./tumix -metrics_addr :9090 -http_trace
  • CI smoke: ./tools/bin/gotestsum -f standard-verbose -- -race -count=1 -shuffle=on -cover ./...

Observability

  • /metrics emits counters: tumix_requests, tumix_input_tokens, tumix_output_tokens, tumix_cost_usd.
  • /debug/vars exposes the same data via expvar; /healthz returns ok.

Documentation

Overview

Command tumix implements a TUMIX: Multi-Agent Test-Time Scaling with Tool-Use Mixture in Go.

Directories

Path Synopsis
Package agent implements 15 pre-designed agents used in TUMIX.
Package agent implements 15 pre-designed agents used in TUMIX.
agenttest
Package agenttest provides in-memory implementations of agent-related interfaces for testing.
Package agenttest provides in-memory implementations of agent-related interfaces for testing.
Package gollm provides ADK LLM integrations backed by external providers.
Package gollm provides ADK LLM integrations backed by external providers.
internal/httputil
Package httputil provides HTTP clients and transports with tuned connection pooling and optional OpenTelemetry tracing controlled by the TUMIX_HTTP_TRACE environment variable.
Package httputil provides HTTP clients and transports with tuned connection pooling and optional OpenTelemetry tracing controlled by the TUMIX_HTTP_TRACE environment variable.
xai module
internal
Package log provides a way to attach a slog.Logger with request-specific attributes to a context.Context.
Package log provides a way to attach a slog.Logger with request-specific attributes to a context.Context.
session
sessionfs
Package sessionfs provides a lightweight file-backed implementation of adk's session.Service.
Package sessionfs provides a lightweight file-backed implementation of adk's session.Service.
httptelemetry
Package httptelemetry provides shared OpenTelemetry helpers for HTTP clients, including a toggleable RoundTripper wrapper that preserves the caller's base transport while emitting spans and metrics when enabled.
Package httptelemetry provides shared OpenTelemetry helpers for HTTP clients, including a toggleable RoundTripper wrapper that preserves the caller's base transport while emitting spans and metrics when enabled.
testing
rr
Package rr provides the recording and replaying testing for HTTP and gRPC.
Package rr provides the recording and replaying testing for HTTP and gRPC.