Skip to content

Home

Neurosurfer β€” AI Agent Framework Neurosurfer β€” AI Agent Framework Neurosurfer β€” AI Agent Framework Quick Start Examples GitHub PyPI Discord

Neurosurfer helps you build intelligent apps that blend LLM reasoning, tools, and retrieval with a ready-to-run FastAPI backend and a React dev UI. Start lean, add power as you go β€” CPU-only or GPU-accelerated.


πŸš€ What’s in the box

  • πŸ€– Agents: Production-ready patterns for ReAct, SQL, RAG, Router etc. think β†’ act β†’ observe β†’ answer
  • 🧠 Models: Unified interface for OpenAI-style and local backends like Transformers/Unsloth, vLLM, Llama.cpp etc.
  • πŸ“š RAG: Simple, swappable retrieval core: embed β†’ search β†’ format β†’ token-aware trimming
  • βš™οΈ FastAPI Server: OpenAI-compatible endpoints for chat + tools β€” custom endpoints, chat handlers, RAG etc.
  • πŸ–₯️ NeurowebUI: React chat UI (GPT-style) that communicates with the server out-of-the-box
  • πŸ§ͺ CLI: neurosurfer serve to run server/UI β€” custom backend app and UI support

πŸŽ“ Tutorials

# Tutorial Link Description
1 Neurosurfer Quickstart Open in Colab Learn how to load local and OpenAI models, stream responses, and build your first RAG and tool-based agents directly in Jupyter or Colab.

More tutorials coming soon β€” covering RAG, Custom Tools, More on Agents, FastAPI integration and more.


πŸ—žοΈ News

  • Agents: ReAct & SQLAgent upgraded with bounded retries, spec-aware input validation, and better final-answer streaming; new ToolsRouterAgent for quick one-shot tool picks.
  • Models: Cleaner OpenAI-style responses across backends; smarter token budgeting + fallbacks when tokenizer isn’t available.
  • Server: Faster startup, better logging/health endpoints, and safer tool execution paths; OpenAI-compatible routes refined for streaming/tool-calling.
  • CLI: serve now runs backend-only or UI-only and auto-injects VITE_BACKEND_URL; new subcommands for ingest/traces to standardize local workflows.

Looking for older updates? Check the repo Releases and Changelog.


⚑ Quick Start

A 60-second path from install β†’ dev server β†’ your first inference.

Install (minimal core):

pip install -U neurosurfer

Or full LLM stack (torch, transformers, bnb, unsloth):

pip install -U "neurosurfer[torch]"

Run the dev server (backend + UI):

neurosurfer serve
- Auto-detects UI; pass --ui-root if needed. First run may npm install.
- Backend binds to config defaults; override with flags or envs.

Dependencies

Before running the CLI, make sure you have environment ready with dependencies installed. For the default UI, cli requires npm, nodejs and serve to be installed on your system.

Hello LLM Example:

from neurosurfer.models.chat_models.transformers import TransformersModel

llm = TransformersModel(
  model_name="unsloth/Llama-3.2-1B-Instruct-bnb-4bit",
  load_in_4bit=True
)
res = llm.ask(user_prompt="Say hi!", system_prompt="Be concise.", stream=False)
print(res.choices[0].message.content)


πŸ—οΈ High-Level Architecture

Neurosurfer Architecture Neurosurfer Architecture

Neurosurfer Architecture


✨ Key Features

  • Production API


    Deploy with FastAPI, authentication, chat APIs, and OpenAI-compatible endpoints.

    Server setup

  • Intelligent Agents


    Build ReAct, SQL, and RAG agents with minimal code. Each agent type is optimized for specific tasks.

    Learn about agents

  • Rich Tool Ecosystem


    Use built-in tools or create your own β€” calculators, web calls, files, custom actions.

    Explore tools

  • RAG System


    Ingest documents, chunk intelligently, and retrieve relevant context for your LLMs.

    RAG System

  • Vector Databases


    Built-in ChromaDB, extensible interface for other stores.

    Vector stores

  • Multi-LLM Support


    Work with OpenAI, Transformers/Unsloth, vLLM, Llama.cpp, and OpenAI-compatible APIs.

    Model docs


πŸ“¦ Install Options

pip (recommended)

pip install -U neurosurfer

pip + full LLM stack

pip install -U "neurosurfer[torch]"

From source

git clone https://github.com/NaumanHSA/neurosurfer.git
cd neurosurfer && pip install -e ".[torch]"

CUDA notes (Linux x86_64):

# Wheels bundle CUDA; you just need a compatible NVIDIA driver.
pip install -U torch --index-url https://download.pytorch.org/whl/cu124
# or CPU-only:
pip install -U torch --index-url https://download.pytorch.org/whl/cpu


πŸ“ License

Licensed under Apache-2.0. See LICENSE.


🌟 Support

  • ⭐ Star the project on GitHub.
  • πŸ’¬ Ask & share in Discussions: Discussions.
  • 🧠 Read the Docs.
  • πŸ› File Issues.
  • πŸ”’ Security: report privately to naumanhsa965@gmail.com.

πŸ“š Citation

If you use Neurosurfer in your work, please cite:

@software{neurosurfer,
  author       = {Nouman Ahsan and Neurosurfer contributors},
  title        = {Neurosurfer: A Production-Ready AI Agent Framework},
  year         = {2025},
  url          = {https://github.com/NaumanHSA/neurosurfer},
  version      = {0.1.0},
  license      = {Apache-2.0}
}

Built with ❀️ by the Neurosurfer team