CLI best practices for LlamaFarm. Covers Cobra, Bubbletea, Lipgloss patterns for Go CLI development.
中文简介正在准备中。当前显示原文说明。
Server-specific best practices for FastAPI, Celery, and Pydantic. Extends python-skills with framework-specific patterns.
中文简介正在准备中。当前显示原文说明。
查看安装方法安装前可以查看交给 AI 代理的指令内容。
Framework-specific patterns and code review checklists for the LlamaFarm Server component.
| Property | Value |
|---|---|
| Path | server/ |
| Python | 3.12+ |
| Framework | FastAPI 0.116+ |
| Task Queue | Celery 5.5+ |
| Validation | Pydantic 2.x, pydantic-settings |
| Logging | structlog with FastAPIStructLogger |
This skill extends the shared Python skills. See:
| Topic | File | Key Points |
|---|---|---|
| FastAPI | fastapi.md | Routes, dependencies, middleware, exception handlers |
| Celery | celery.md | Task patterns, error handling, retries, signatures |
| Pydantic | pydantic.md | Pydantic v2 models, validation, serialization |
| Performance | performance.md | Async patterns, caching, connection pooling |
server/
├── main.py # Uvicorn entry point, MCP mount
├── api/
│ ├── main.py # FastAPI app factory, middleware setup
│ ├── errors.py # Custom exceptions + exception handlers
│ ├── middleware/ # ASGI middleware (structlog, errors)
│ └── routers/ # API route modules
│ ├── projects/ # Project CRUD endpoints
│ ├── datasets/ # Dataset management
│ ├── rag/ # RAG query endpoints
│ └── ...
├── core/
│ ├── settings.py # pydantic-settings configuration
│ ├── logging.py # structlog setup, FastAPIStructLogger
│ └── celery/ # Celery app configuration
│ ├── celery.py # Celery app instance
│ └── rag_client.py # RAG task signatures and helpers
├── services/ # Business logic layer
│ ├── project_service.py # Project CRUD operations
│ ├── dataset_service.py # Dataset management
│ └── ...
├── agents/ # AI agent implementations
└── tests/ # Pytest test suite
from pydantic_settings import BaseSettings
class Settings(BaseSettings, env_file=".env"):
HOST: str = "0.0.0.0"
PORT: int = 14345
LOG_LEVEL: str = "INFO"
settings = Settings() # Module-level singleton
from core.logging import FastAPIStructLogger
logger = FastAPIStructLogger(__name__)
logger.info("Operation completed", extra={"count": 10, "duration_ms": 150})
logger.bind(namespace=namespace, project=project_id) # Add context
# Define exception hierarchy
class NotFoundError(Exception): ...
class ProjectNotFoundError(NotFoundError):
def __init__(self, namespace: str, project_id: str):
self.namespace = namespace
self.project_id = project_id
super().__init__(f"Project {namespace}/{project_id} not found")
# Register handler in api/errors.py
async def _handle_project_not_found(request: Request, exc: Exception) -> Response:
payload = ErrorResponse(error="ProjectNotFound", message=str(exc))
return JSONResponse(status_code=404, content=payload.model_dump())
def register_exception_handlers(app: FastAPI) -> None:
app.add_exception_handler(ProjectNotFoundError, _handle_project_not_found)
class ProjectService:
@classmethod
def get_project(cls, namespace: str, project_id: str) -> Project:
project_dir = cls.get_project_dir(namespace, project_id)
if not os.path.isdir(project_dir):
raise ProjectNotFoundError(namespace, project_id)
# ... load and validate
FastAPI Routes (High priority)
response_model=Celery Tasks (High priority)
Pydantic Models (Medium priority)
Performance (Medium 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.
中文简介正在准备中。当前显示原文说明。