You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A FastAPI-based mock LLM server that mimics OpenAI and Anthropic API formats. Instead of calling actual language models,
8
-
it uses predefined responses from a YAML configuration file.
7
+
A FastAPI-based mock LLM server that mimics OpenAI and Anthropic API formats. Instead of calling actual language models, it uses predefined responses from a YAML configuration file.
9
8
10
9
This is made for when you want a deterministic response for testing or development purposes.
11
10
@@ -17,8 +16,6 @@ Check out the [CodeGate](https://github.com/stacklok/codegate) project when you'
17
16
- Streaming support (character-by-character response streaming)
18
17
- Configurable responses via YAML file
19
18
- Hot-reloading of response configurations
20
-
- JSON logging
21
-
- Error handling
22
19
- Mock token counting
23
20
24
21
## Installation
@@ -128,10 +125,11 @@ curl -X POST http://localhost:8000/v1/messages \
128
125
129
126
### Response Configuration
130
127
131
-
Responses are configured in `responses.yml`. The file has two main sections:
128
+
Responses are configured in `responses.yml`. The file has three main sections:
132
129
133
130
1.`responses`: Maps input prompts to predefined responses
134
131
2.`defaults`: Contains default configurations like the unknown response message
132
+
3.`settings`: Contains server behavior settings like network lag simulation
135
133
136
134
Example `responses.yml`:
137
135
```yaml
@@ -141,71 +139,39 @@ responses:
141
139
142
140
defaults:
143
141
unknown_response: "I don't know the answer to that. This is a mock response."
144
-
```
145
-
146
-
### Hot Reloading
147
-
148
-
The server automatically detects changes to `responses.yml` and reloads the configuration without requiring a restart.
149
-
150
-
## Development
151
-
152
-
The project uses Poetry for dependency management and includes a Makefile to help with common development tasks:
0 commit comments