Quick Start Guide

Get up and running with Cerebrate File in 5 minutes

Table of contents

  1. 1. Install Cerebrate File
  2. 2. Set Your API Key
  3. 3. Process Your First File
    1. Simple Processing
    2. Save to New File
  4. 4. Common Use Cases
    1. Summarize a Document
    2. Improve Code Documentation
    3. Translate Content
    4. Process Multiple Files
  5. 5. Essential Options
    1. Chunking Options
    2. Model Parameters
    3. Debug and Test
  6. 6. Advanced Features
    1. Recursive Processing
    2. Using Instruction Files
    3. Parallel Processing
  7. 7. Monitor Progress
  8. 8. Check Your Results
  9. 9. Troubleshooting Quick Fixes
    1. API Key Not Found
    2. Rate Limited
    3. File Too Large
    4. Out of Memory
  10. 10. Next Steps
  11. Quick Reference Card
    1. Essential Commands
    2. Key Parameters
    3. Chunking Strategies
  12. Getting Help

1. Install Cerebrate File

# Using pip
pip install cerebrate-file

# Using uv (faster)
uv pip install cerebrate-file

2. Set Your API Key

Get your API key from cerebras.ai and set it:

export CEREBRAS_API_KEY="csk-your-api-key-here"

3. Process Your First File

Simple Processing

# Process a single file (overwrites original)
cerebrate-file document.md --prompt "Improve clarity and grammar"

Save to New File

# Process and save to a new file
cerebrate-file input.md --output improved.md --prompt "Fix typos and improve flow"

4. Common Use Cases

Summarize a Document

cerebrate-file report.md \
  --prompt "Summarize to 500 words with key points" \
  --output summary.md

Improve Code Documentation

cerebrate-file script.py \
  --prompt "Add comprehensive docstrings and comments" \
  --data_format code \
  --output documented.py

Translate Content

cerebrate-file article.md \
  --prompt "Translate to Spanish, keep formatting" \
  --output articulo.md

Process Multiple Files

# Process all markdown files in current directory
cerebrate-file . \
  --recurse "*.md" \
  --prompt "Add table of contents" \
  --output ./processed/

5. Essential Options

Chunking Options

# For large documents
cerebrate-file large_doc.md --chunk_size 48000

# For code files
cerebrate-file app.py --data_format code

# For articles
cerebrate-file article.txt --data_format semantic

Model Parameters

# More creative output
cerebrate-file story.md --temp 0.9

# More consistent output
cerebrate-file technical.md --temp 0.3

Debug and Test

# See what's happening
cerebrate-file doc.md --verbose

# Test without API calls
cerebrate-file doc.md --dry_run

6. Advanced Features

Recursive Processing

Process entire directory trees:

# Process all Python files recursively
cerebrate-file ./src \
  --recurse "**/*.py" \
  --prompt "Add type hints" \
  --output ./typed/ \
  --workers 4

Using Instruction Files

For complex instructions:

# Create instruction file
cat > instructions.md << EOF
1. Fix all grammar and spelling errors
2. Improve sentence structure
3. Add section summaries
4. Ensure consistent tone
EOF

# Use instruction file
cerebrate-file document.md \
  --file_prompt instructions.md \
  --output edited.md

Parallel Processing

Speed up multiple files:

# Process with 8 parallel workers
cerebrate-file . \
  --recurse "**/*.md" \
  --workers 8 \
  --output ./processed/

7. Monitor Progress

The tool shows:

  • Progress bar with percentage
  • Current file being processed
  • Files completed
  • Remaining API calls

8. Check Your Results

After processing:

# View the output
cat output.md

# Compare with original
diff input.md output.md

# Check remaining API calls
cerebrate-file small.txt --verbose | grep "Remaining"

9. Troubleshooting Quick Fixes

API Key Not Found

echo 'CEREBRAS_API_KEY=csk-...' > .env

Rate Limited

# Use fewer workers
cerebrate-file . --recurse "**/*.md" --workers 2

File Too Large

# Use smaller chunks
cerebrate-file large.md --chunk_size 16000

Out of Memory

# Process sequentially
cerebrate-file . --recurse "**/*.md" --workers 1

10. Next Steps

Now that you’re up and running:

  1. Explore More Options: See CLI Reference
  2. Learn Best Practices: Read Configuration Guide
  3. See Examples: Browse Real-World Examples
  4. Troubleshoot Issues: Check Troubleshooting Guide

Quick Reference Card

Essential Commands

TaskCommand
Process filecerebrate-file input.md
Save to new filecerebrate-file input.md -o output.md
Add instructionscerebrate-file doc.md -p "instructions"
Process directorycerebrate-file . --recurse "*.md"
Test chunkingcerebrate-file doc.md --dry_run
Debug modecerebrate-file doc.md --verbose

Key Parameters

ParameterPurposeExample
--outputOutput path--output result.md
--promptInstructions--prompt "Summarize"
--recursePattern--recurse "**/*.py"
--workersParallel--workers 8
--chunk_sizeChunk size--chunk_size 32000
--data_formatStrategy--data_format code
--tempTemperature--temp 0.7
--verboseDebug info--verbose

Chunking Strategies

FormatBest ForExample
markdownDocumentsREADME, docs
codeSource files.py, .js, .java
semanticArticlesBlog posts, essays
textPlain textCSV, logs, data

Getting Help


Back to top

Copyright © 2024-2025 Adam Twardoch. Distributed under the Apache 2.0 license.