Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
run-llama avatar

Classify Files According To Specific Rules

  • 3 installs
  • 177 repo stars
  • Updated November 3, 2025
  • run-llama/vibe-llama

Classifies documents and files against natural-language rules using the llama_cloud_services beta ClassifyClient.

About

Teaches the correct llama_cloud_services API for text and document classification by defining ClassifierRule objects and running the ClassifyClient against files. A developer uses it before writing LlamaCloud classification code.

  • Defines ClassifierRule types with natural-language descriptions
  • Uses ClassifyClient.aclassify_file_path with implicit PDF parsing

Classify Files According To Specific Rules by the numbers

  • 3 all-time installs (skills.sh)
  • Ranked #13,677 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/run-llama/vibe-llama --skill classify-files-according-to-specific-rules

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs3
repo stars177
Last updatedNovember 3, 2025
Repositoryrun-llama/vibe-llama

What it does

Classifies documents and files against natural-language rules using the llama_cloud_services beta ClassifyClient.

Files

SKILL.mdMarkdownGitHub ↗

Texts and Files Classification

Quick start

  • Define classification rules:
from llama_cloud.types import ClassifierRule

# Define classification rules (natural language descriptions)
rules = [
    ClassifierRule(
        type="invoice",
        description="Documents that are invoices for goods or services, containing line items, prices, and payment terms",
    ),
    ClassifierRule(
        type="contract",
        description="Legal agreements between parties, containing terms, conditions, and signatures",
    ),
    ClassifierRule(
        type="receipt",
        description="Proof of payment documents, typically shorter than invoices, showing items purchased and amount paid",
    ),
]
  • Create the classification client and run the job:
from llama_cloud_services.beta.classifier.client import ClassifyClient

# Initialize client
# Note: the beta client differs in usage slightly compared to other clients in llama-cloud-services
classifier = ClassifyClient.from_api_key(api_key)

# Classify a PDF directly (parsing happens implicitly)
result = await classifier.aclassify_file_path(
    rules=rules,
    file_input_path="document.pdf",
)

# Access classification results
classification = result.items[0].result
print(f"Predicted Type: {classification.type}")
print(f"Confidence: {classification.confidence:.2%}")
print(f"Reasoning: {classification.reasoning}")

For more detailed code implementations, see REFERENCE.md.

Requirements

The llama_cloud_services package must be installed in your environment (with it come the pydantic and llama_cloud packages):

pip install llama_cloud_services

And the LLAMA_CLOUD_API_KEY must be available as an environment variable:

export LLAMA_CLOUD_API_KEY="..."

For more detailed code implementations, see REFERENCE.md.

Requirements

The llama_cloud_services package must be installed in your environment:

pip install llama_cloud_services

And the LLAMA_CLOUD_API_KEY must be available as an environment variable:

export LLAMA_CLOUD_API_KEY="..."

Related skills

AI & Agent Buildingllmautomation

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.