server-price-tracker

module
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: Apache-2.0

README

server price tracker

An API-first Go service that monitors eBay listings for server hardware, extracts structured attributes via LLM (Ollama, Anthropic Claude, or compatible backends), scores listings against historical baselines, and alerts on deals via Discord webhooks. The CLI acts as a client to the API, and the API design supports future integrations (Discord bot, web UI, Grafana dashboards).

See the Usage Guide for a walkthrough of the full pipeline — from creating watches to receiving deal alerts — with HTTP API and CLI examples.

Extraction Test Results

Validated against mistral:7b-instruct-v0.3-q5_K_M via Ollama:

Type Title Key Extractions Product Key
RAM Samsung 32GB DDR4-2666 PC4-21300 ECC Registered RDIMM generation: DDR4, speed_mhz: 2666, ecc: true, registered: true ram:ddr4:ecc_reg:32gb:2666
Drive Samsung PM893 960GB SATA 2.5" SSD MZ-7L3960A Enterprise interface: SATA, form_factor: 2.5, type: SSD drive:sata:2.5:960gb:ssd
Server Dell PowerEdge R740xd 2U 24x 2.5" SFF 2x Xeon Gold 6130 64GB DDR4 H730P manufacturer: Dell, model: PowerEdge R740xd, form_factor: 2U, cpu_count: 2 server:dell:poweredge_r740xd:unknown
CPU Intel Xeon Gold 6248R 3.0GHz 24-Core 35.75MB LGA3647 CPU Processor SRGZG family: Xeon, series: Gold, model: 6248R, cores: 24 cpu:intel:xeon:6248r
NIC Mellanox ConnectX-4 Lx CX4121A 25GbE SFP28 Dual Port PCIe 3.0 x8 Network Card speed: 25GbE, port_count: 2, port_type: SFP28 nic:25gbe:2p:sfp28

LLM Extraction Schema

The extraction pipeline classifies each eBay listing into a component type, then extracts structured attributes using component-specific prompts. A pre-validation normalization pass (pkg/extract/normalize.go) repairs common LLM mistakes (unit confusion in capacity_gb, placeholder strings like "N/A", speed_mhz pulled from PC4 byte-rate markers) before validation enforces required fields and enum values. Fields marked required will fail validation if the LLM returns null and the value cannot be recovered. See docs/EXTRACTION.md for the full normalization rules and docs/SQL_HELPERS.md for backfill queries when listings get stuck unextracted.

Common Fields (all component types)
Field Type Required Values
condition enum yes new, like_new, used_working, for_parts, unknown
confidence float yes 0.0 - 1.0
quantity integer no >= 1 (default 1)
RAM
Field Type Required Values
manufacturer string no
part_number string no
capacity_gb integer yes 1 - 1024
generation enum yes DDR3, DDR4, DDR5
speed_mhz integer no 800 - 8400 (e.g. 2133, 2400, 2666, 3200)
ecc boolean no
registered boolean no
form_factor string no
rank string no
voltage string no
compatible_servers [string] no
Drive
Field Type Required Values
manufacturer string no
part_number string no
capacity string yes
capacity_bytes integer no
interface enum yes SAS, SATA, NVMe, U.2
form_factor enum no 2.5, 3.5
type enum no SSD, HDD
rpm integer no
endurance string no
encryption boolean no
carrier_included boolean no
carrier_type string no
Server
Field Type Required Values
manufacturer string yes
model string yes
generation string no
form_factor enum no 1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U, 10U, tower
drive_bays string no
drive_form_factor string no
cpu_count integer no
cpu_model string no
cpu_installed boolean no
ram_total_gb integer no
ram_stick_count integer no
ram_slots_total integer no
drives_included boolean no
drive_blanks_included boolean no
raid_controller string no
power_supplies integer no
idrac_license string no
ilo_license string no
rails_included boolean no
bezel_included boolean no
network_card string no
boots_tested boolean no
CPU
Field Type Required Values
manufacturer enum yes Intel, AMD
family enum yes Xeon, EPYC
series string no
model string yes
generation string no
cores integer no 1 - 256
threads integer no
base_clock_ghz float no 0.5 - 6.0
boost_clock_ghz float no
tdp_watts integer no 10 - 500
socket string no
l3_cache_mb integer no
part_number string no
matched_pair boolean no
NIC
Field Type Required Values
manufacturer string no
model string no
speed enum yes 1GbE, 10GbE, 25GbE, 40GbE, 100GbE
port_count integer yes 1 - 8
port_type enum no SFP+, SFP28, QSFP+, QSFP28, RJ45, BaseT
interface string no
pcie_generation string no
firmware_protocol string no
part_number string no
oem_part_number string no
low_profile boolean no
transceivers_included boolean no

Directories

Path Synopsis
cmd
server-price-tracker command
Package main is the entry point for the server-price-tracker.
Package main is the entry point for the server-price-tracker.
server-price-tracker/cmd
Package cmd implements the CLI commands for server-price-tracker.
Package cmd implements the CLI commands for server-price-tracker.
spt command
Package main is the entry point for the spt CLI client.
Package main is the entry point for the spt CLI client.
spt/cmd
Package cmd implements the spt CLI commands.
Package cmd implements the spt CLI commands.
internal
api/client
Package client provides a thin HTTP client for the server-price-tracker API.
Package client provides a thin HTTP client for the server-price-tracker API.
api/handlers
Package handlers — alerts_ui.go implements the server-rendered alert review UI from DESIGN-0010 / IMPL-0015 Phase 4.
Package handlers — alerts_ui.go implements the server-rendered alert review UI from DESIGN-0010 / IMPL-0015 Phase 4.
api/middleware
Package middleware provides Echo middleware for server-price-tracker.
Package middleware provides Echo middleware for server-price-tracker.
api/web
Package web embeds and serves the alert review UI assets.
Package web embeds and serves the alert review UI assets.
api/web/components
Package components holds the templ components rendered by the alert review UI.
Package components holds the templ components rendered by the alert review UI.
config
Package config handles loading and validating the application configuration from YAML files with environment variable substitution.
Package config handles loading and validating the application configuration from YAML files with environment variable substitution.
ebay
Package ebay provides an eBay Browse API client abstracted behind interfaces for testability.
Package ebay provides an eBay Browse API client abstracted behind interfaces for testability.
engine
Package engine implements the core business logic loops: scoring, ingestion, baseline recomputation, and alert evaluation.
Package engine implements the core business logic loops: scoring, ingestion, baseline recomputation, and alert evaluation.
metrics
Package metrics defines Prometheus metrics for server-price-tracker.
Package metrics defines Prometheus metrics for server-price-tracker.
notify
Package notify defines the notification interface and implementations for alert delivery.
Package notify defines the notification interface and implementations for alert delivery.
observability
Package observability provides OpenTelemetry SDK initialisation for the server-price-tracker binary.
Package observability provides OpenTelemetry SDK initialisation for the server-price-tracker binary.
regression
Package regression carries the shared shape of the `testdata/golden_classifications.json` regression dataset and the helpers all four operator CLIs (`tools/dataset-bootstrap`, `tools/dataset-upload`, `tools/regression-runner`, plus the build- tagged `pkg/extract/regression_test.go` stub) consume.
Package regression carries the shared shape of the `testdata/golden_classifications.json` regression dataset and the helpers all four operator CLIs (`tools/dataset-bootstrap`, `tools/dataset-upload`, `tools/regression-runner`, plus the build- tagged `pkg/extract/regression_test.go` stub) consume.
store
Package store defines the datastore abstraction for server-price-tracker.
Package store defines the datastore abstraction for server-price-tracker.
version
Package version exposes build-time identifiers (commit SHA, semver) so runtime code can attach them to telemetry resource attributes and log fields.
Package version exposes build-time identifiers (commit SHA, semver) so runtime code can attach them to telemetry resource attributes and log fields.
pkg
extract
Package extract provides LLM-based attribute extraction for eBay listings, abstracted behind interfaces for testability.
Package extract provides LLM-based attribute extraction for eBay listings, abstracted behind interfaces for testability.
judge
Package judge implements the LLM-as-judge worker that grades fired alerts retrospectively against an operator-curated rubric (see IMPL-0019 Phase 5 / DESIGN-0016).
Package judge implements the LLM-as-judge worker that grades fired alerts retrospectively against an operator-curated rubric (see IMPL-0019 Phase 5 / DESIGN-0016).
logger
Package logger provides centralized slog.Logger construction with configurable level and output format (text or JSON).
Package logger provides centralized slog.Logger construction with configurable level and output format (text or JSON).
observability/langfuse
Package langfuse provides an in-house HTTP client for Langfuse (https://langfuse.com/), the LLM-observability backend used by IMPL-0019 to capture every LLMBackend.Generate call as a Langfuse generation linked to the active OTel trace.
Package langfuse provides an in-house HTTP client for Langfuse (https://langfuse.com/), the LLM-observability backend used by IMPL-0019 to capture every LLMBackend.Generate call as a Langfuse generation linked to the active OTel trace.
scorer
Package score implements the composite deal scoring algorithm for eBay listings.
Package score implements the composite deal scoring algorithm for eBay listings.
types
Package domain defines the core business types for the server price tracker.
Package domain defines the core business types for the server price tracker.
test
utils
Package testhelper provides shared utilities for integration and e2e tests.
Package testhelper provides shared utilities for integration and e2e tests.
tools
dataset-bootstrap command
Package main is the operator-facing CLI for bootstrapping the regression dataset (testdata/golden_classifications.json).
Package main is the operator-facing CLI for bootstrapping the regression dataset (testdata/golden_classifications.json).
dataset-upload command
Package main is the operator-facing CLI for uploading the curated regression dataset (testdata/golden_classifications.json) to Langfuse as one DatasetItem per row.
Package main is the operator-facing CLI for uploading the curated regression dataset (testdata/golden_classifications.json) to Langfuse as one DatasetItem per row.
docgen command
Package main generates CLI reference documentation from the spt command tree.
Package main generates CLI reference documentation from the spt command tree.
judge-bootstrap command
Package main is the operator-facing CLI for bootstrapping the LLM-as-judge few-shot example set (pkg/judge/examples.json).
Package main is the operator-facing CLI for bootstrapping the LLM-as-judge few-shot example set (pkg/judge/examples.json).
mock-server command
Package main implements a mock eBay API server for local development.
Package main implements a mock eBay API server for local development.
regression-runner command
Package main is the operator-facing CLI for running the extraction regression suite against one or more configured LLM backends.
Package main is the operator-facing CLI for running the extraction regression suite against one or more configured LLM backends.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL