CLI best practices for LlamaFarm. Covers Cobra, Bubbletea, Lipgloss patterns for Go CLI development.
日本語の概要は準備中です。原文の説明を表示しています。
Shared Python best practices for LlamaFarm. Covers patterns, async, typing, testing, error handling, and security.
インストール方法を見るインストールする前に、エージェントに与えられる指示の中身を確認できます。
Shared Python best practices and code review checklists for all Python components in the LlamaFarm monorepo.
| Component | Path | Python | Key Dependencies |
|---|---|---|---|
| Server | server/ | 3.12+ | FastAPI, Celery, Pydantic, structlog |
| RAG | rag/ | 3.11+ | LlamaIndex, ChromaDB, Celery |
| Universal Runtime | runtimes/universal/ | 3.11+ | PyTorch, transformers, FastAPI |
| Config | config/ | 3.11+ | Pydantic, JSONSchema |
| Common | common/ | 3.10+ | HuggingFace Hub |
| Topic | File | Key Points |
|---|---|---|
| Patterns | patterns.md | Dataclasses, Pydantic, comprehensions, imports |
| Async | async.md | async/await, asyncio, concurrent execution |
| Typing | typing.md | Type hints, generics, protocols, Pydantic |
| Testing | testing.md | Pytest fixtures, mocking, async tests |
| Errors | error-handling.md | Custom exceptions, logging, context managers |
| Security | security.md | Path traversal, injection, secrets, deserialization |
LlamaFarm uses ruff with shared configuration in ruff.toml:
line-length = 88
target-version = "py311"
select = ["E", "F", "I", "B", "UP", "SIM"]
Key rules:
from pydantic_settings import BaseSettings
class Settings(BaseSettings, env_file=".env"):
LOG_LEVEL: str = "INFO"
HOST: str = "0.0.0.0"
PORT: int = 14345
settings = Settings() # Singleton at module level
from core.logging import FastAPIStructLogger # Server
from core.logging import RAGStructLogger # RAG
from core.logging import UniversalRuntimeLogger # Runtime
logger = FastAPIStructLogger(__name__)
logger.info("Operation completed", extra={"count": 10, "duration_ms": 150})
from abc import ABC, abstractmethod
class Component(ABC):
def __init__(self, name: str, config: dict[str, Any] | None = None):
self.name = name or self.__class__.__name__
self.config = config or {}
@abstractmethod
def process(self, documents: list[Document]) -> ProcessingResult:
pass
from dataclasses import dataclass, field
@dataclass
class Document:
content: str
metadata: dict[str, Any] = field(default_factory=dict)
id: str = field(default_factory=lambda: str(uuid.uuid4()))
from pydantic import BaseModel, Field, ConfigDict
class EmbeddingRequest(BaseModel):
model: str
input: str | list[str]
encoding_format: Literal["float", "base64"] | None = "float"
model_config = ConfigDict(str_strip_whitespace=True)
Each Python component follows this structure:
component/
├── pyproject.toml # UV-managed dependencies
├── core/ # Core functionality
│ ├── __init__.py
│ ├── settings.py # Pydantic Settings
│ └── logging.py # structlog setup
├── services/ # Business logic (server)
├── models/ # ML models (runtime)
├── tasks/ # Celery tasks (rag)
├── utils/ # Utility functions
└── tests/
├── conftest.py # Shared fixtures
└── test_*.py
When reviewing Python code in LlamaFarm:
Patterns (Medium priority)
Async (High priority)
Typing (Medium priority)
Testing (Medium priority)
Errors (High priority)
Security (Critical priority)
See individual topic files for detailed checklists with grep patterns.
まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
CLI best practices for LlamaFarm. Covers Cobra, Bubbletea, Lipgloss patterns for Go CLI development.
日本語の概要は準備中です。原文の説明を表示しています。
Comprehensive code review for diffs. Analyzes changed code for security vulnerabilities, anti-patterns, and quality issues. Auto-detects domain (frontend/backend) from file paths.
日本語の概要は準備中です。原文の説明を表示しています。
Commit changes, push to GitHub, and open a PR. Includes quality checks (security, patterns, simplification). Use --quick to skip checks.
日本語の概要は準備中です。原文の説明を表示しています。
Best practices for the Common utilities package in LlamaFarm. Covers HuggingFace Hub integration, GGUF model management, and shared utilities.
日本語の概要は準備中です。原文の説明を表示しています。
Configuration module patterns for LlamaFarm. Covers Pydantic v2 models, JSONSchema generation, YAML processing, and validation.
日本語の概要は準備中です。原文の説明を表示しています。
Designer subsystem patterns for LlamaFarm. Covers React 18, TanStack Query, TailwindCSS, and Radix UI.
日本語の概要は準備中です。原文の説明を表示しています。