MCP Catalogs
首页

FastAPI-BitNet

by grctest·38·综合分 42

基于FastAPI的BitNet模型MCP服务器,支持会话管理、聊天和基准测试功能。

ai-llmdeveloper-tools
14
Forks
1
活跃 Issue
11 个月前
最近提交
2 天前
收录于

概述

FastAPI-BitNet是一个使用FastAPI构建的强大REST API,用于管理和与BitNet模型实例交互。它允许开发人员以编程方式控制llama-cli和llama-server进程,用于自动化测试、基准测试和交互式聊天会话。该服务器通过模型上下文协议与VS Code Copilot集成,使开发工作流程中能够无缝交互模型。

试试问 AI

装完之后,这里有 5 个你可以让 AI 做的事:

:对BitNet模型进行编程测试和基准测试
:通过API与多个BitNet实例聊天
:将BitNet功能作为工具集成到VS Code Copilot中
:支持哪些模型?
:如何与VS Code集成?

什么时候选它

当您需要为微软BitNet模型提供MCP接口,并需要全面的会话管理和基准测试功能,尤其是与VS Code集成时,选择FastAPI-BitNet。

什么时候不要选它

不适合需要高可用性或负载均衡的生产环境,因为它似乎是单实例实现,没有内置冗余机制。

此 server 暴露的工具

从 README 抽取出 9 个工具
  • create_session

    Start a new llama-cli or llama-server session

  • stop_session

    Stop a running llama-cli or llama-server session

  • check_session_status

    Check the status of a running session

  • chat_with_session

    Send a prompt to a running BitNet session and receive a response

  • initialize_multiple_instances

    Initialize multiple BitNet instances simultaneously

  • shutdown_multiple_instances

    Shut down multiple BitNet instances in a single API call

  • run_benchmark

    Run a benchmark test on a GGUF model

  • calculate_perplexity

    Calculate perplexity scores for a model on test data

  • estimate_server_capacity

    Estimate maximum number of BitNet instances the server can handle

说明:Tool names inferred from feature descriptions in the README, as no explicit 'Tools' section was found. The README describes functionality for session management, chat operations, and benchmarking, which were mapped to tool names.

可对比工具

llama-cpp-mcptransformers-mcpollama-mcpvllm-mcp

安装

安装

  1. 前置条件:Docker Desktop、Conda、Python 3.10+
  2. 设置Python环境:

``bash conda create -n bitnet python=3.11 conda activate bitnet ``

  1. 安装Huggingface CLI:

``bash pip install -U "huggingface_hub[cli]" ``

  1. 下载BitNet模型:

``bash huggingface-cli download microsoft/BitNet-b1.58-2B-4T-gguf --local-dir app/models/BitNet-b1.58-2B-4T ``

  1. 使用Docker运行(推荐):

``bash docker build -t fastapi_bitnet . docker run -d --name ai_container -p 8080:8080 fastapi_bitnet ``

Claude Desktop配置

添加到claude_desktop_config.json

{
  "mcpServers": {
    "fastapi-bitnet": {
      "command": "http",
      "args": ["http://localhost:8080/mcp"]
    }
  }
}

FAQ

支持哪些模型?
目前支持GGUF格式的Microsoft BitNet-b1.58-2B-4T模型。
如何与VS Code集成?
运行服务器并配置VS Code Copilot将'http://localhost:8080/mcp'用作HTTP MCP服务器。

FastAPI-BitNet 对比

GitHub →

最后更新于 · 由 README + GitHub 公开数据自动生成。