Bayesian MCP

Integrations

  • Uses FastAPI to expose the Bayesian MCP server API endpoints for model creation, belief updating, prediction generation, model comparison, and visualization.

  • Provides installation instructions for cloning the repository from GitHub to set up the Bayesian MCP server.

  • Utilizes NumPy for numerical computations in Bayesian inference, handling arrays and mathematical operations for probabilistic models.

베이지안 MCP

베이지안 추론, 추론 및 신념 업데이트를 위한 모델 호출 프로토콜(MCP) 서버입니다. 이 도구를 통해 LLM은 엄격한 베이지안 분석 및 확률적 추론을 수행할 수 있습니다.

특징

  • 🧠 베이지안 추론 : MCMC 샘플링을 사용하여 새로운 증거로 신념 업데이트
  • 📊 모델 비교 : 정보 기준을 사용하여 경쟁 모델을 비교합니다.
  • 🔮 예측 추론 : 불확실성 정량화를 통해 예측 생성
  • 📈 시각화 : 사후 분포의 시각화를 만듭니다.
  • 🔌 MCP 통합 : MCP를 지원하는 모든 LLM과 원활하게 통합

설치

개발 설치

저장소를 복제하고 종속성을 설치합니다.

지엑스피1

요구 사항

  • 파이썬 3.9 이상
  • 파이엠씨 5.0+
  • 아르비즈
  • 넘파이
  • 맷플롯립
  • 패스트API
  • 유비콘

빠른 시작

서버 시작

# Run with default settings python bayesian_mcp.py # Specify host and port python bayesian_mcp.py --host 0.0.0.0 --port 8080 # Set log level python bayesian_mcp.py --log-level debug

서버가 시작되어 지정된 호스트와 포트에서 MCP 요청을 수신합니다.

API 사용

베이지안 MCP 서버는 API를 통해 여러 기능을 제공합니다.

1. 모델 생성

지정된 변수로 새로운 베이지안 모델을 만듭니다.

# MCP Request { "function_name": "create_model", "parameters": { "model_name": "my_model", "variables": { "theta": { "distribution": "normal", "params": {"mu": 0, "sigma": 1} }, "likelihood": { "distribution": "normal", "params": {"mu": "theta", "sigma": 0.5}, "observed": [0.1, 0.2, 0.3, 0.4] } } } }

2. 신념을 업데이트하세요

새로운 증거를 바탕으로 모델 신념을 업데이트합니다.

# MCP Request { "function_name": "update_beliefs", "parameters": { "model_name": "my_model", "evidence": { "data": [0.1, 0.2, 0.3, 0.4] }, "sample_kwargs": { "draws": 1000, "tune": 1000, "chains": 2 } } }

3. 예측하기

사후 분포를 사용하여 예측을 생성합니다.

# MCP Request { "function_name": "predict", "parameters": { "model_name": "my_model", "variables": ["theta"], "conditions": { "x": [1.0, 2.0, 3.0] } } }

4. 모델 비교

정보 기준을 사용하여 여러 모델을 비교합니다.

# MCP Request { "function_name": "compare_models", "parameters": { "model_names": ["model_1", "model_2"], "metric": "waic" } }

5. 시각화 만들기

모델 사후 분포의 시각화를 생성합니다.

# MCP Request { "function_name": "create_visualization", "parameters": { "model_name": "my_model", "plot_type": "trace", "variables": ["theta"] } }

예시

examples/ 디렉토리에는 베이지안 MCP 서버를 사용하는 방법을 보여주는 여러 가지 예가 포함되어 있습니다.

선형 회귀

매개변수 추정을 보여주기 위한 간단한 선형 회귀 예제:

python examples/linear_regression.py

A/B 테스트

전환율에 대한 베이지안 A/B 테스트의 예:

python examples/ab_test.py

지원되는 배포판

베이지안 엔진은 다음과 같은 분포를 지원합니다.

  • normal : 정규(가우스) 분포
  • lognormal : 로그 정규 분포
  • beta : 베타 분포
  • gamma : 감마 분포
  • exponential 분포
  • uniform : 균일 분포
  • bernoulli : 베르누이 분포
  • binomial : 이항분포
  • poisson : 푸아송 분포
  • deterministic : 결정론적 변환

MCP 통합

이 서버는 모델 호출 프로토콜(Model Calling Protocol)을 구현하여 다양한 LLM 및 프레임워크와 호환됩니다. LLM과 함께 사용하려면 다음 단계를 따르세요.

import requests response = requests.post("http://localhost:8000/mcp", json={ "function_name": "create_model", "parameters": { "model_name": "example_model", "variables": {...} } }) result = response.json()

특허

MIT

크레딧

Wrench AI 프레임워크의 개념과 코드를 기반으로 합니다.

-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

LLM이 추론, 모델 비교, 불확실성 정량화를 통한 예측 모델링을 포함하여 엄격한 베이지안 분석과 확률적 추론을 수행할 수 있도록 하는 모델 호출 프로토콜 서버입니다.

  1. 특징
    1. 설치
      1. 개발 설치
      2. 요구 사항
    2. 빠른 시작
      1. 서버 시작
    3. API 사용
      1. 모델 생성
      2. 신념을 업데이트하세요
      3. 예측하기
      4. 모델 비교
      5. 시각화 만들기
    4. 예시
      1. 선형 회귀
      2. A/B 테스트
    5. 지원되는 배포판
      1. MCP 통합
        1. 특허
          1. 크레딧

            Related MCP Servers

            • -
              security
              A
              license
              -
              quality
              A Model Context Protocol server that enables LLMs to analyze options chains, calculate Greeks, and evaluate basic options strategies through Yahoo Finance data.
              Last updated -
              4
              Python
              MIT License
              • Apple
              • Linux
            • A
              security
              A
              license
              A
              quality
              A Model Context Protocol server that provides basic mathematical and statistical functions to LLMs, enabling them to perform accurate numerical calculations through a simple API.
              Last updated -
              13
              2
              TypeScript
              MIT License
            • A
              security
              A
              license
              A
              quality
              A Model Context Protocol server that enables LLMs to perform precise numerical calculations by evaluating mathematical expressions.
              Last updated -
              1
              48
              Python
              MIT License
              • Linux
              • Apple
            • -
              security
              F
              license
              -
              quality
              Enables LLMs to perform statistical analysis and generate ML predictions on user data from databases or CSV files through a Model Context Protocol server.
              Last updated -
              Python

            View all related MCP servers

            ID: om8g7ez16q