Imported from ForeverAngry/rig-model-catalog (
AGENTS.md). Install upstream withnpx skills add ForeverAngry/rig-model-catalog. Copyright stays with the author.
AGENTS.md
Guidance for AI coding agents working in rig-model-catalog. Mirrors
.github/copilot-instructions.md.
Project
rig-model-catalog is the provider-agnostic model-catalogdata layer for the
Rig ecosystem. Public primitives:
ModelMetaProbetrait — asyncdescribe(model) -> Result<Option<...>>(src/probe.rs).ModelDescriptor/Capability/Quantization/ProviderId(src/descriptor.rs).StubProbe,ChainedProbe(src/stub.rs, src/chained.rs).OllamaProbe(featureollama, src/ollama.rs).StaticProbe(featurestatic, src/static_catalog.rs) backed bydata/openai.json+data/anthropic.json.
Rules
- Rust 2024, MSRV 1.89. Library is runtime-agnostic; do not add
tokioto[dependencies]. - Errors: typed
thiserrorenum in src/error.rs; returnResult<_, ProbeError>. UseOptionfor "unknown is normal" cases — do not useErrto mean "model not in catalog." - Never
.awaitwhile holding aMutex/RwLockguard. Scope-drop first (clippy::await_holding_lock = deny). - No
unwrap,expect,panic!,todo!,unimplemented!,dbg!, indexing/slicing, orunreachable!in library code — clippydeny/forbid. Use?,ok_or(ProbeError::...),get(..),match,strip_suffix. Allowed intests/,examples/,#[cfg(test)]blocks (gate with#[allow(clippy::unwrap_used, clippy::panic, clippy::indexing_slicing)]). - Use
tracingfor logs; noprintln!in library code. - Document new
pubitems with///rustdoc; provide ano_run/ doctested example for new traits or probe types. - Re-export new public items from src/lib.rs.
ModelDescriptoris#[non_exhaustive]— adding a field is additive. Renaming or removing a field is a breaking change.
Feature flags
Default = none. Optional: ollama (pulls reqwest), static (bundled
JSON via include_str!), rig-hook (pulls rig-core for PromptHook
telemetry), observe (extends rig-hook to emit the rig_tap JSON
wire shape without depending on rig-tap), and pricing (bundled
pricing catalog). Gate optional code with #[cfg(feature = "...")]. CI
matrix covers default, individual feature combos, combined provider/catalog
features, and all-features.
Validation
just check
# fmt --check + clippy (× feature combos) + tests + examples
Integration tests live in tests/. Examples must keep building:
cargo build --examples --all-features.
Scope
Do not vendor rig-core. The crate must not depend on rig-memvid,
rig-compose, rig-resources, rig-mcp, or rig-retrieval-evals — it must
remain consumable by all of them. Update README.md and
CHANGELOG.md for user-visible changes.