- Add README table-of-contents link for REST API.

- Document REST API server startup and capabilities.
- Add endpoint overview for chat, patterns, contexts.
- Describe sessions management and model listing endpoints.
- Provide curl examples for key API workflows.
- Explain Ollama compatibility mode endpoints and port.
This commit is contained in:
Kayvan Sylvan
2025-12-17 19:02:04 -08:00
parent 833b09081e
commit 99b8b6a972
3 changed files with 384 additions and 1 deletions

View File

@@ -38,6 +38,7 @@
[Philosophy](#philosophy) •
[Installation](#installation) •
[Usage](#usage) •
[REST API](#rest-api-server) •
[Examples](#examples) •
[Just Use the Patterns](#just-use-the-patterns) •
[Custom Patterns](#custom-patterns) •
@@ -170,6 +171,7 @@ Keep in mind that many of these were recorded when Fabric was Python-based, so r
- [Usage](#usage)
- [Debug Levels](#debug-levels)
- [Extensions](#extensions)
- [REST API Server](#rest-api-server)
- [Our approach to prompting](#our-approach-to-prompting)
- [Examples](#examples)
- [Just use the Patterns](#just-use-the-patterns)
@@ -299,7 +301,7 @@ docker run --rm -it -v $HOME/.fabric-config:/root/.config/fabric kayvan/fabric:l
# Use Fabric with your patterns
docker run --rm -it -v $HOME/.fabric-config:/root/.config/fabric kayvan/fabric:latest -p summarize
# Run the REST API server
# Run the REST API server (see REST API Server section)
docker run --rm -it -p 8080:8080 -v $HOME/.fabric-config:/root/.config/fabric kayvan/fabric:latest --serve
```
@@ -721,6 +723,25 @@ Fabric supports extensions that can be called within patterns. See the [Extensio
**Important:** Extensions only work within pattern files, not via direct stdin. See the guide for details and examples.
## REST API Server
Fabric includes a built-in REST API server that exposes all core functionality over HTTP. Start the server with:
```bash
fabric --serve
```
The server provides endpoints for:
- Chat completions with streaming responses
- Pattern management (create, read, update, delete)
- Context and session management
- Model and vendor listing
- YouTube transcript extraction
- Configuration management
For complete endpoint documentation, authentication setup, and usage examples, see [REST API Documentation](docs/rest-api.md).
## Our approach to prompting
Fabric _Patterns_ are different than most prompts you'll see.