agentleFS
xybrid-aixybrid-ai/xybrid/.agents/skills/test-model/SKILL.md

test-model

Skill524 starsChanged 3 days agoApache-2.0View on GitHub

Test a model end-to-end using the xybrid execution system.

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. Pipelex/pipelex★ 951same name
    2. guoqingbao/vllm.rs★ 345same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository4 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 4 are distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Test a model end-to-end using the xybrid execution system.

    line 6
  2. Very specific:

    If $ARGUMENTS is provided, use it to find the model.

    line 16
  3. Distinctive:

    Search for the model in these locations (in order):

    line 18
  4. Very specific:

    Verify that model_metadata.json exists in the model directory.

    line 24
  5. Very specific:

    Read model_metadata.json and check:

    line 30
  6. Distinctive:

    If any check fails, report the specific issue and suggest how to fix it.

    line 37
  7. Very specific:

    Check for an existing example in crates/xybrid-core/examples/ that matches the model.

    line 59
  8. Very specific:

    If no example exists, create a minimal one at crates/xybrid-core/examples/{model_id}_test.rs:

    line 61
  9. Very specific:

    Run from the repos/xybrid/ directory (or the repo root if that's where Cargo.toml is):

    line 97
  10. Distinctive:

    Add feature flags based on the model type (see table in Step 3).

    line 103
  11. Distinctive:

    Check the output based on model type:

    line 109
  12. Very specific:

    "model_metadata.json not found": Check the model directory path

    line 135
  13. Very specific:

    "feature not enabled": Add the required feature flag (e.g.

    line 140
  14. Very specific:

    "llm backend not available": Add --features llm-llamacpp for GGUF models

    line 141

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Test a model end-to-end using the xybrid execution system.

The user should specify which model to test (e.g., "test kokoro-82m" or "test the TTS model").

Input: $ARGUMENTS (optional — model name or path to model directory)


Step 1: Locate the Model

If $ARGUMENTS is provided, use it to find the model. Otherwise ask which model to test.

Search for the model in these locations (in order):

  1. Direct path if $ARGUMENTS is a directory path
  2. integration-tests/fixtures/models/{name}/
  3. ~/.xybrid/cache/{name}/
  4. Current directory

Verify that model_metadata.json exists in the model directory.


Step 2: Validate model_metadata.json

Read model_metadata.json and check:

  1. All files listed in files array exist in the model directory
  2. model_file in execution_template points to an actual file
  3. JSON is valid and has required fields (model_id, version, execution_template, files)
  4. Preprocessing/postprocessing types are valid enum values

If any check fails, report the specific issue and suggest how to fix it.


Step 3: Determine Test Strategy

Based on the execution_template.type and metadata.task:

TaskInputExpected OutputFeature Flags
text-to-speechEnvelope::Text("Hello world")Audio bytes (length > 0)default
speech-recognition (Onnx)Envelope::Audio(wav_bytes)Text transcriptiondefault
speech-recognition (GgmlWhisper)Envelope::Audio(wav_bytes)Text transcriptionasr-whispercpp (in every platform-* preset)
speech-recognition (SafeTensors)Envelope::Audio(wav_bytes)Text transcriptioncandle,candle-metal — opt-in only; no preset enables Candle
text-generation (Gguf)Envelope::Text("Hello")Text responsellm-llamacpp
text-embeddingEnvelope::Text("test sentence")Embedding vector (f32)default
image_classificationRaw image bytesClass probabilitiesdefault

Step 4: Find or Create Test Example

Check for an existing example in crates/xybrid-core/examples/ that matches the model.

If no example exists, create a minimal one at crates/xybrid-core/examples/{model_id}_test.rs:

//! Test example for {model_id}
use std::collections::HashMap;
use std::path::PathBuf;
use xybrid_core::execution::{ModelMetadata, TemplateExecutor};
use xybrid_core::ir::{Envelope, EnvelopeKind};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let model_dir = PathBuf::from("integration-tests/fixtures/models/{model_id}");
    let metadata_path = model_dir.join("model_metadata.json");
    let metadata: ModelMetadata = serde_json::from_str(&std::fs::read_to_string(&metadata_path)?)?;

    let mut executor = TemplateExecutor::with_base_path(model_dir.to_str().unwrap());

    // Create appropriate input based on model task
    let input = Envelope {
        kind: EnvelopeKind::Text("Hello world".into()), // adjust per task
        metadata: HashMap::new(),
    };

    // Third arg is an optional `&GenerationConfig` override.
    let output = executor.execute(&metadata, &input, None)?;
    println!("Output: {:?}", output.kind);
    println!("Test passed!");
    Ok(())
}

Adjust the input type based on the model task (Text for TTS/LLM/embedding, Audio for ASR).


Step 5: Run the Test

Run from the repos/xybrid/ directory (or the repo root if that's where Cargo.toml is):

cargo run --example {example_name} -p xybrid-core --features {features}

Add feature flags based on the model type (see table in Step 3).


Step 6: Validate Output

Check the output based on model type:

  • TTS: Output should be EnvelopeKind::Audio(bytes) with bytes.len() > 0. Optionally save to output.wav for manual listening.
  • ASR: Output should be EnvelopeKind::Text(transcription) with non-empty text.
  • LLM: Output should be EnvelopeKind::Text(response) with non-empty text.
  • Embedding: Output should be EnvelopeKind::Embedding(vec) with expected dimensionality.
  • Classification: Output should contain class probabilities or indices.

Step 7: Report Results

Print a summary:

Model: {model_id}
Task:  {task}
Input: {input_type}
Output: {output_summary}
Status: PASS / FAIL

{If FAIL: specific error message and suggestion}

Common Issues

  • "model_metadata.json not found": Check the model directory path
  • "file not found": A file listed in files array doesn't exist — download it or fix the path
  • "preprocessing failed": Wrong preprocessing step for the model type
  • "ONNX error": Model file may be corrupted or wrong format
  • "SafeTensors execution requires the 'candle' feature": the bundle is a Candle/SafeTensors model and no platform-* preset enables Candle any more. Either add --features candle explicitly, or switch to the GGML bundle (ExecutionTemplate::GgmlWhisper) that runs on asr-whispercpp — e.g. whisper-tiny-ggml instead of whisper-tiny.
  • "feature not enabled": Add the required feature flag (e.g. --features asr-whispercpp for GGML Whisper, --features candle for SafeTensors)
  • "llm backend not available": Add --features llm-llamacpp for GGUF models

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.