### Run Development Server Source: https://github.com/lmnr-ai/lmnr/blob/main/app-server/README.md Use this command to start the backend server during development. Ensure all system dependencies are installed. ```sh cargo run ``` -------------------------------- ### Spin Up Full Stack Dependency Containers Source: https://github.com/lmnr-ai/lmnr/blob/main/CONTRIBUTING.md Start PostgreSQL, ClickHouse, and RabbitMQ for full-stack development. ```sh docker compose -f docker-compose-local-dev-full.yml up ``` -------------------------------- ### Install Frontend Dependencies Source: https://github.com/lmnr-ai/lmnr/blob/main/CLAUDE.md Use this command to install all necessary dependencies for the Next.js frontend. Ensure you are in the 'frontend' directory. ```bash cd frontend pnpm install ``` -------------------------------- ### Configure Frontend Environment Variables Source: https://github.com/lmnr-ai/lmnr/blob/main/CONTRIBUTING.md Copy the example environment file to a local file for frontend development. ```sh cd frontend cp .env.local.example .env.local ``` -------------------------------- ### Run Frontend in Development Mode Source: https://github.com/lmnr-ai/lmnr/blob/main/CONTRIBUTING.md Start the frontend development server using pnpm. Changes are hot-reloaded. ```sh cd frontend pnpm run dev ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/lmnr-ai/lmnr/blob/main/frontend/README.md Installs all project dependencies using pnpm. Ensure pnpm is installed globally before running this command. ```bash npm install ``` -------------------------------- ### Install Laminr Python SDK Source: https://github.com/lmnr-ai/lmnr/blob/main/README.md Install the Laminr Python SDK and all instrumentation packages using pip. The '[all]' option installs all available instruments. ```sh pip install --upgrade 'lmnr[all]' ``` -------------------------------- ### Spin Up Development Containers (Frontend Only) Source: https://github.com/lmnr-ai/lmnr/blob/main/CONTRIBUTING.md Start the application server and PostgreSQL database for frontend development. ```sh docker compose -f docker-compose-local-dev.yml up ``` -------------------------------- ### Install Stagehand and Laminar SDKs Source: https://github.com/lmnr-ai/lmnr/blob/main/frontend/assets/blog/2025-12-08-stagehand-laminar.mdx Install the necessary packages for Stagehand and Laminar using npm. ```bash npm install @lmnr-ai/lmnr @browserbasehq/stagehand ``` -------------------------------- ### Configure Full Stack Environment Variables Source: https://github.com/lmnr-ai/lmnr/blob/main/CONTRIBUTING.md Copy example environment files to local files for both the app server and frontend. ```sh cp .env.example .env # and for frontend: cp frontend/.env.local.example frontend/.env.local ``` -------------------------------- ### Install Laminr TS SDK Source: https://github.com/lmnr-ai/lmnr/blob/main/README.md Install the Laminr TypeScript SDK and all instrumentation packages using npm. ```sh npm add @lmnr-ai/lmnr ``` -------------------------------- ### Install pnpm Source: https://github.com/lmnr-ai/lmnr/blob/main/frontend/README.md Installs pnpm globally using npm. This is a prerequisite for managing project dependencies. ```bash npm install -g pnpm # install pnpm globally ``` -------------------------------- ### Run Development Server Source: https://github.com/lmnr-ai/lmnr/blob/main/frontend/README.md Starts the frontend application in development mode using pnpm. This command is used for local development and testing. ```bash pnpm run dev ``` -------------------------------- ### Copy Environment Files Source: https://github.com/lmnr-ai/lmnr/blob/main/CLAUDE.md Copy example environment files to create active configuration files for the application server and frontend. The app server reads `.env` from the repository root. ```bash cp app-server/.env.example .env # app-server reads .env at the repo root (dotenv::dotenv) cp frontend/.env.local.example frontend/.env.local ``` -------------------------------- ### Docker Compose for Full-Stack Development Source: https://github.com/lmnr-ai/lmnr/blob/main/CLAUDE.md Starts all required services using Docker Compose for a full-stack development environment. After starting the services, run the app server and frontend development server in separate terminals. ```bash docker compose -f docker-compose-local-dev-full.yml up # All dependencies cd app-server && cargo r # Terminal 1 cd frontend && pnpm run dev # Terminal 2 ``` -------------------------------- ### Run App Server in Development Mode Source: https://github.com/lmnr-ai/lmnr/blob/main/CONTRIBUTING.md Start the Rust app server. Recompile and rerun after making backend changes. ```sh cd app-server cargo r ``` -------------------------------- ### Install Laminar for Claude Agent SDK (Python) Source: https://github.com/lmnr-ai/lmnr/blob/main/frontend/assets/blog/2025-12-03-claude-agent-sdk-instrumentation.mdx Install the Laminar package with Claude Agent SDK support using pip or uv. Ensure your project API key is set as an environment variable. ```bash pip install lmnr[claude-agent-sdk] # or uv add lmnr[claude-agent-sdk] export LMNR_PROJECT_API_KEY=YOUR_PROJECT_KEY ``` -------------------------------- ### Smoke Test: Start PII Redactor Service Source: https://github.com/lmnr-ai/lmnr/blob/main/pii-redactor/README.md Verify the PII Redactor service is running by starting it in a Docker container and listing its services using grpcurl. ```bash docker run --rm -p 8910:8910 lmnr/pii-redactor:latest & sleep 2 grpcurl -plaintext localhost:8910 list ``` -------------------------------- ### Docker Compose for Frontend-Only Development Source: https://github.com/lmnr-ai/lmnr/blob/main/CLAUDE.md Starts the application server using a pre-built Docker image and then runs the frontend development server. This is suitable when only frontend changes are being made. ```bash docker compose -f docker-compose-local-dev.yml up cd frontend && pnpm run dev ``` -------------------------------- ### Conversational REPL Interaction Example Source: https://github.com/lmnr-ai/lmnr/blob/main/frontend/assets/blog/2026-02-10-rebuilding-my-first-startup-as-an-ai-agent.mdx Demonstrates a conversational interaction with an AI agent, showing how user queries trigger specific tool calls and provide data-driven answers. Useful for understanding the agent's dynamic response mechanism. ```text > liveable -------------------- Washington, DC (20001) | Pop: 44,056 | Walk Score: 90 > Is this neighborhood safe? - Crime & Safety Search("20001 Washington DC crime rate...") - Called 3 sources in 12.4s The violent crime rate in 20001 is 66.8 per 1,000 residents, 194% above the national average. Sources: FBI UCR, NeighborhoodScout | Confidence: Moderate > How does that compare to Gaithersburg? - Geocoding("20878") - Resolved in 0.2s - Census Data("20878") - Loaded in 1.4s Much safer by the numbers. Violent crime in 20878 is 15.3 per 1,000, 32.6% below national average. Roughly 4x lower than DC. Sources: Census ACS, AreaVibes | Confidence: High ``` -------------------------------- ### Clone and Run Laminar with Docker Compose Source: https://github.com/lmnr-ai/lmnr/blob/main/README.md Use this command to quickly set up a local instance of Laminar AI for testing or lightweight usage. Ensure Docker is installed and running. ```sh git clone https://github.com/lmnr-ai/lmnr cd lmnr docker compose up -d ``` -------------------------------- ### Start Slack Broker Integration Source: https://github.com/lmnr-ai/lmnr/blob/main/CLAUDE.md Initiates the Slack integration process in brokered mode. This endpoint is called when the Slack connect button is used in brokered mode. ```APIDOC ## POST /api/integrations/slack/broker-start ### Description Initiates the Slack integration process in brokered mode by POSTing to the broker's /start endpoint. It then redirects the user to the authorization URL provided by the broker. ### Method POST ### Endpoint /api/integrations/slack/broker-start ### Parameters #### Query Parameters - **returnUrl** (string) - Required - The URL the broker should redirect to after authorization, including workspace context. ### Request Example (No request body, parameters are typically passed as query parameters or headers) ### Response #### Redirect - **302 Found** - Redirects to the `authorizeUrl` obtained from the broker. #### Response Example (Redirect response, no JSON body) ``` -------------------------------- ### Initialize Laminar and Observe Claude Agent SDK (Python) Source: https://github.com/lmnr-ai/lmnr/blob/main/frontend/assets/blog/2025-12-03-claude-agent-sdk-instrumentation.mdx Initialize Laminar and use the @observe decorator to trace calls made with the Claude Agent SDK. This setup collects LLM prompts, tool inputs, and outputs. ```python import asyncio from claude_agent_sdk import ClaudeSDKClient from lmnr import Laminar, observe Laminar.initialize() @observe() async def main(): async with ClaudeSDKClient() as client: await client.query( "Explain to me with examples, how memoization speeds up recursive " "function calls. Use the Fibonacci sequence as an example." ) async for msg in client.receive_response(): print(msg) if __name__ == "__main__": asyncio.run(main()) ``` -------------------------------- ### Download OpenAI Privacy Filter Model Source: https://github.com/lmnr-ai/lmnr/blob/main/pii-redactor/README.md Installs `huggingface_hub` CLI and downloads the ONNX model and associated files for OpenAI's privacy filter. Ensure external data shards are placed correctly. ```bash pip install -U "huggingface_hub[cli]" mkdir -p models huggingface-cli download openai/privacy-filter \ tokenizer.json config.json \ onnx/model.onnx onnx/model.onnx_data onnx/model.onnx_data_1 onnx/model.onnx_data_2 \ --local-dir ./hf_download cp ./hf_download/tokenizer.json ./hf_download/config.json models/ cp ./hf_download/onnx/model.onnx models/model.onnx cp ./hf_download/onnx/model.onnx_data* models/ ``` -------------------------------- ### Build Frontend for Production Source: https://github.com/lmnr-ai/lmnr/blob/main/CLAUDE.md Creates a production-ready build of the Next.js frontend application. Run this command from the 'frontend' directory. ```bash cd frontend pnpm build ``` -------------------------------- ### Initialize Quickwit Indexes Source: https://github.com/lmnr-ai/lmnr/blob/main/CLAUDE.md Applies Quickwit index configurations at boot time. The `signal_events` index uses `mode: dynamic` with a JSON payload field. ```yaml mode: dynamic default_search_fields: [] fields: - name: payload type: json - name: project_id type: raw tokenizer: raw fast: true - name: signal_id type: raw tokenizer: raw fast: true - name: trace_id type: raw tokenizer: raw fast: true - name: id type: raw tokenizer: raw fast: true - name: severity type: u64 ``` -------------------------------- ### Install Laminar for Claude Agent SDK (TypeScript/JavaScript) Source: https://github.com/lmnr-ai/lmnr/blob/main/frontend/assets/blog/2025-12-03-claude-agent-sdk-instrumentation.mdx Install the Laminar package and the Claude Agent SDK for TypeScript/JavaScript. Ensure you are using version 0.7.10 or higher for Laminar. Set your project API key as an environment variable. ```bash npm install @lmnr-ai/lmnr @anthropic-ai/claude-agent-sdk # or pnpm add @lmnr-ai/lmnr @anthropic-ai/claude-agent-sdk export LMNR_PROJECT_API_KEY=YOUR_PROJECT_KEY ``` -------------------------------- ### Initialize Laminar SDK (Python) Source: https://github.com/lmnr-ai/lmnr/blob/main/frontend/assets/blog/2026-03-05-migrate-from-helicone-to-laminar.mdx Initialize the Laminar SDK with your project API key. This should be done as early as possible in your application's entry point. ```python import os from lmnr import Laminar Laminar.initialize(project_api_key=os.environ["LMNR_PROJECT_API_KEY"]) ``` -------------------------------- ### Build Rust Backend for Production Source: https://github.com/lmnr-ai/lmnr/blob/main/CLAUDE.md Compiles the Rust backend application with optimizations for production release. Execute from the 'app-server' directory. ```bash cd app-server cargo build --release ``` -------------------------------- ### Get Effective Limits Source: https://github.com/lmnr-ai/lmnr/blob/main/CLAUDE.md Calculates the effective usage limits for a project or workspace. This is enforced in the application server. ```rust get_effective_*_limit ``` -------------------------------- ### Wrap Tool Calls with Laminar Span (Python) Source: https://github.com/lmnr-ai/lmnr/blob/main/frontend/assets/blog/2026-03-05-migrate-from-helicone-to-laminar.mdx Instrument tool calls by starting a new span with `span_type='TOOL'` to differentiate them in traces. ```python Laminar.start_as_current_span(..., span_type="TOOL") ``` -------------------------------- ### PII Redaction Server Gate Source: https://github.com/lmnr-ai/lmnr/blob/main/CLAUDE.md This function checks if a user is on a Pro or Enterprise tier, which is required for PII redaction. It short-circuits to allowed for self-hosted installations. ```typescript export async function isProOrEnterpriseTier(projectId: ProjectId): Promise { if (!Feature.LAMINAR_CLOUD) { return true; // Self-hosted installs are not on tiered billing } const project = await db.projects.getProjectById(projectId); if (!project) { throw new TRPCError({ code: "NOT_FOUND", message: "Project not found." }); } const subscriptionTiers = await db.subscriptionTiers.getSubscriptionTiers(); const unlimitedTier = subscriptionTiers.find((tier) => tier.name === "unlimited"); // Check if the project's tier is Pro, Enterprise, or Unlimited (for self-hosted) return ( project.tier === "pro" || project.tier === "enterprise" || (unlimitedTier && project.subscriptionTierId === unlimitedTier.id) ); } ``` -------------------------------- ### Initialize Laminar with Project API Key Source: https://github.com/lmnr-ai/lmnr/blob/main/frontend/assets/blog/2026-02-10-rebuilding-my-first-startup-as-an-ai-agent.mdx Initializes the Laminar SDK with your project's API key. Ensure the LMNR_PROJECT_API_KEY environment variable is set. ```python from lmnr import Laminar, observe Laminar.initialize(project_api_key=os.environ["LMNR_PROJECT_API_KEY"]) ``` -------------------------------- ### Build and Run PII Redactor with Docker Source: https://github.com/lmnr-ai/lmnr/blob/main/pii-redactor/README.md Build the Docker image and run the PII Redactor service. This method bakes weights from HuggingFace into the image. ```bash cd pii-redactor docker build -t lmnr/pii-redactor:latest . docker run --rm -p 8910:8910 lmnr/pii-redactor:latest ``` -------------------------------- ### Run Full Stack Integration Test Source: https://github.com/lmnr-ai/lmnr/blob/main/CONTRIBUTING.md Build and run the app server and frontend in production mode within Docker for integration testing. ```sh # stop all the development servers: # docker compose down docker compose -f docker-compose-local-build.yml up ``` -------------------------------- ### Get Project and Workspace Billing Info Source: https://github.com/lmnr-ai/lmnr/blob/main/CLAUDE.md Retrieves billing information for a project and its associated workspace. This function reads custom byte and signal step limits. ```rust get_project_and_workspace_billing_info ``` -------------------------------- ### Mint Project API Key Source: https://github.com/lmnr-ai/lmnr/blob/main/CLAUDE.md Mints a project-specific API key for the authenticated user. This endpoint is used during the CLI setup process and requires a session token. ```shell POST /api/cli/api-key # Requires session token as bearer # Body: # { # projectId?, # deviceName? # } # Response: # { # apiKey, # apiKeyId, # projectId, # projectName, # workspaceId, # workspaceName # } ``` -------------------------------- ### Initialize Laminar SDK (TypeScript) Source: https://github.com/lmnr-ai/lmnr/blob/main/frontend/assets/blog/2026-03-05-migrate-from-helicone-to-laminar.mdx Initialize the Laminar SDK with your project API key. This should be done as early as possible in your application's entry point. ```typescript import { Laminar } from "@lmnr-ai/lmnr"; Laminar.initialize({ projectApiKey: process.env.LMNR_PROJECT_API_KEY!, }); ``` -------------------------------- ### Build Docker Image with Different Model Variant (int8) Source: https://github.com/lmnr-ai/lmnr/blob/main/pii-redactor/README.md Build the Docker image, specifying build arguments to bake in an int8 quantized model variant. This results in a smaller image but potentially slower CPU inference. ```bash docker build -t lmnr/pii-redactor:latest \ --build-arg HF_MODEL_FILE=onnx/model_quantized.onnx \ --build-arg HF_MODEL_DATA_FILES=onnx/model_quantized.onnx_data \ . ``` -------------------------------- ### Export Piiranha Model with Optimum CLI Source: https://github.com/lmnr-ai/lmnr/blob/main/pii-redactor/README.md Exports the Piiranha model for token classification using `optimum-cli` and ONNX Runtime. Ensure `transformers`, `optimum[onnxruntime]`, `onnx`, and `onnxruntime` are installed. ```bash pip install -U transformers "optimum[onnxruntime]" onnx onnxruntime mkdir -p models optimum-cli export onnx \ --model iiiorg/piiranha-v1-detect-personal-information \ --task token-classification \ --opset 17 \ models/ ``` -------------------------------- ### Check Frontend Linting Source: https://github.com/lmnr-ai/lmnr/blob/main/CLAUDE.md Runs the linter to check for code style and potential issues in the frontend codebase. Execute from the 'frontend' directory. ```bash cd frontend pnpm lint ``` -------------------------------- ### Trace Function Calls with Laminr Python Source: https://github.com/lmnr-ai/lmnr/blob/main/README.md Use the `@observe()` decorator to trace inputs and outputs of functions in Python. This example shows tracing a function that generates a poem using the OpenAI client. ```python import os from openai import OpenAI from lmnr import observe, Laminar Laminar.initialize(project_api_key="") client = OpenAI(api_key=os.environ["OPENAI_API_KEY"]) @observe() # annotate all functions you want to trace def poem_writer(topic): response = client.chat.completions.create( model="gpt-4o", messages=[ {"role": "user", "content": f"write a poem about {topic}"}, ], ) poem = response.choices[0].message.content return poem if __name__ == "__main__": print(poem_writer(topic="laminar flow")) ```