Bayesian MCP
베이지안 MCP
베이지안 추론, 추론 및 신념 업데이트를 위한 모델 호출 프로토콜(MCP) 서버입니다. 이 도구를 통해 LLM은 엄격한 베이지안 분석 및 확률적 추론을 수행할 수 있습니다.
특징
🧠 베이지안 추론 : MCMC 샘플링을 사용하여 새로운 증거로 신념 업데이트
📊 모델 비교 : 정보 기준을 사용하여 경쟁 모델을 비교합니다.
🔮 예측 추론 : 불확실성 정량화를 통해 예측 생성
📈 시각화 : 사후 분포의 시각화를 만듭니다.
🔌 MCP 통합 : MCP를 지원하는 모든 LLM과 원활하게 통합
Related MCP server: Calculator MCP Server
설치
개발 설치
저장소를 복제하고 종속성을 설치합니다.
지엑스피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.pyA/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 프레임워크의 개념과 코드를 기반으로 합니다.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server for building and testing AI agents with multi-model experimentation and insights.
MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.
Related MCP Servers
- AlicenseAqualityCmaintenanceA Model Context Protocol server that provides basic mathematical and statistical functions to LLMs, enabling them to perform accurate numerical calculations through a simple API.13191MIT
- AlicenseCqualityDmaintenanceA Model Context Protocol server that enables LLMs to perform precise numerical calculations by evaluating mathematical expressions.16,210 PyPI160MIT
- FlicenseNot gradedqualityDmaintenanceEnables LLMs to perform statistical analysis and generate ML predictions on user data from databases or CSV files through a Model Context Protocol server.2-
- AlicenseAqualityCmaintenanceA Model Context Protocol server that empowers AI agents with metacognitive monitoring to detect reasoning loops and provide intelligent recovery using case-based reasoning and statistical analysis.948 npm9MIT