Skip to content

taha-yassine/llama.ipsum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Llama.Ipsum

A lightweight mock server that simulates the OpenAI API for development and testing purposes.

Features

  • Implements key OpenAI API endpoints:
    • /v1/chat/completions
    • /v1/completions
    • /v1/models
  • Supports API key authentication
  • Logs requests and responses
  • Supports streaming responses
    • Configurable throughput (tokens per second)
  • Handles tool calls

Installation

  1. Clone the repository:

    git clone https://github.com/taha-yassine/llama-ipsum.git
    cd llama-ipsum
  2. Run the server:

    just run

Template Customization

The mock server uses Jinja2 templates to generate responses. You can customize these templates to fit your specific testing needs.

Using Custom Templates

  1. Create a directory for your custom templates:

    mkdir -p my_templates
  2. Copy the templates you want to customize:

    # Example: customize chat completion response
    cp app/templates/chat/completion.json.jinja my_templates/chat/
  3. Edit the templates according to your needs.

  4. Start the server with your custom templates:

    uv run -m app.main --template-dir /path/to/my_templates

License

This project is licensed under the MIT License.

About

A lightweight mock server that simulates the OpenAI API for development and testing purposes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages