MCPcopy Index your code
hub / github.com/edgenai/edgen

github.com/edgenai/edgen @v0.1.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.4 ↗ · + Follow
563 symbols 1,153 edges 108 files 131 documented · 23%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README
<img alt="GitHub" src="https://img.shields.io/github/license/edgenai/edgen">

A Local GenAI API Server: A drop-in replacement for OpenAI's API for Local GenAI

|

<a href="https://docs.edgen.co"><b>Documentation</b></a> |
<a href="https://blog.edgen.co"><b>Blog</b></a> |
<a href="https://discord.gg/QUXbwqdMRs"><b>Discord</b></a> |
<a href="https://github.com/orgs/edgenai/projects/1/views/1"><b>Roadmap</b></a> |







<img src="https://edgen.co/images/demo.gif" alt="EdgenChat, a local chat app powered by ⚡Edgen">



    <a href="https://chat.edgen.co">EdgenChat</a>, a local chat app powered by ⚡Edgen
  • [x] OpenAI Compliant API: ⚡Edgen implements an OpenAI compatible API, making it a drop-in replacement.
  • [x] Multi-Endpoint Support: ⚡Edgen exposes multiple AI endpoints such as chat completions (LLMs) and speech-to-text (Whisper) for audio transcriptions.
  • [x] Model Agnostic: LLMs (Llama2, Mistral, Mixtral...), Speech-to-text (whisper) and many others.
  • [x] Optimized Inference: You don't need to take a PhD in AI optimization. ⚡Edgen abstracts the complexity of optimizing inference for different hardware, platforms and models.
  • [x] Modular: ⚡Edgen is model and runtime agnostic. New models can be added easily and ⚡Edgen can select the best runtime for the user's hardware: you don't need to keep up about the latest models and ML runtimes - ⚡Edgen will do that for you.
  • [x] Model Caching: ⚡Edgen caches foundational models locally, so 1 model can power hundreds of different apps - users don't need to download the same model multiple times.
  • [x] Native: ⚡Edgen is built in 🦀Rust and is natively compiled to all popular platforms: Windows, MacOS and Linux. No docker required.
  • [ ] Graphical Interface: A graphical user interface to help users efficiently manage their models, endpoints and permissions.

⚡Edgen lets you use GenAI in your app, completely locally on your user's devices, for free and with data-privacy. It's a drop-in replacement for OpenAI (it uses the a compatible API), supports various functions like text generation, speech-to-text and works on Windows, Linux, and MacOS.

Features

  • [x] Session Caching: ⚡Edgen maintains top performance with big contexts (big chat histories), by caching sessions. Sessions are auto-detected in function of the chat history.
  • [x] GPU support: CUDA, Vulkan. Metal

Endpoints

Supported Models

Check in the documentation

Supported platforms

  • [x] Windows
  • [x] Linux
  • [x] MacOS

🔥 Hot Topics

Why local GenAI?

  • Data Private: On-device inference means users' data never leave their devices.

  • Scalable: More and more users? No need to increment cloud computing infrastructure. Just let your users use their own hardware.

  • Reliable: No internet, no downtime, no rate limits, no API keys.

  • Free: It runs locally on hardware the user already owns.

Quickstart

  1. Download and start ⚡Edgen
  2. Chat with ⚡EdgenChat

Ready to start your own GenAI application? Checkout our guides!

⚡Edgen usage:

Usage: edgen [<command>] [<args>]

Toplevel CLI commands and options. Subcommands are optional. If no command is provided "serve" will be invoked with default options.

Options:
  --help            display usage information

Commands:
  serve             Starts the edgen server. This is the default command when no
                    command is provided.
  config            Configuration-related subcommands.
  version           Prints the edgen version to stdout.
  oasgen            Generates the Edgen OpenAPI specification.

edgen serve usage:

Usage: edgen serve [-b <uri...>] [-g]

Starts the edgen server. This is the default command when no command is provided.

Options:
  -b, --uri         if present, one or more URIs/hosts to bind the server to.
                    `unix://` (on Linux), `http://`, and `ws://` are supported.
                    For use in scripts, it is recommended to explicitly add this
                    option to make your scripts future-proof.
  -g, --nogui       if present, edgen will not start the GUI; the default
                    behavior is to start the GUI.
  --help            display usage information

GPU Support

⚡Edgen also supports compilation and execution on a GPU, when building from source, through Vulkan, CUDA and Metal. The following cargo features enable the GPU:

  • llama_vulkan - execute LLM models using Vulkan. Requires a Vulkan SDK to be installed.
  • llama_cuda - execute LLM models using CUDA. Requires a CUDA Toolkit to be installed.
  • llama_metal - execute LLM models using Metal.
  • whisper_cuda - execute Whisper models using CUDA. Requires a CUDA Toolkit to be installed.

Note that, at the moment, llama_vulkan, llama_cuda and llama_metal cannot be enabled at the same time.

Example usage (building from source, you need to first install the prerequisites):

cargo run --features llama_vulkan --release -- serve

Architecture Overview

<img src="https://github.com/edgenai/edgen/raw/v0.1.4/docs/assets/edgen_architecture_overview.svg" alt="⚡Edgen architecture overview" width="400">

⚡Edgen architecture overview

Contribute

If you don't know where to start, check Edgen's roadmap! Before you start working on something, see if there's an existing issue/pull-request. Pop into Discord to check with the team or see if someone's already tackling it.

Communication Channels

Special Thanks

Extension points exported contracts — how you extend this code

AsyncConstructor (Interface)
An asynchronous constructor for a [`Perishable`] value. This is implemented, by default, for all `async fn() -> T` type [1 …
crates/edgen_core/src/perishable.rs
AsyncConstructor (Interface)
An asynchronous constructor for a [`Perishable`] value. This is implemented, by default, for all `async fn() -> T` type [1 …
crates/edgen_server/src/util/perishable.rs
Section (Interface)
(no doc)
docs/src/components/SectionProvider.tsx
LLMEndpoint (Interface)
A large language model endpoint, that is, an object that provides various ways to interact with a large language model. [1 …
crates/edgen_core/src/llm.rs
SectionState (Interface)
(no doc)
docs/src/components/SectionProvider.tsx
WhisperEndpoint (Interface)
(no doc) [1 implementers]
crates/edgen_core/src/whisper.rs
NavGroup (Interface)
(no doc)
docs/src/components/Navigation.tsx
Endpoint (Interface)
(no doc)
docs/src/components/Endpoints.tsx

Core symbols most depended-on inside this repo

clone
called by 41
crates/edgen_core/src/perishable.rs
block_on
called by 16
crates/edgen_async_compat/src/lib.rs
get
called by 16
crates/edgen_rt_llama_cpp/src/lib.rs
spawn
called by 14
crates/edgen_async_compat/src/lib.rs
get_chat_completions_status
called by 9
crates/edgen_server/src/status.rs
get_audio_transcriptions_status
called by 9
crates/edgen_server/src/status.rs
into_response
called by 8
crates/edgen_server/src/openai_shim.rs
remToPx
called by 7
docs/src/lib/remToPx.ts

Shape

Function 394
Method 81
Class 57
Enum 23
Interface 8

Languages

Rust71%
TypeScript27%
Python2%

Modules by API surface

crates/edgen_server/src/model_man.rs43 symbols
crates/edgen_server/src/status.rs33 symbols
crates/edgen_server/src/openai_shim.rs31 symbols
crates/edgen_server/tests/common/mod.rs30 symbols
crates/edgen_core/src/settings.rs30 symbols
crates/edgen_rt_llama_cpp/src/lib.rs28 symbols
crates/edgen_core/src/perishable.rs25 symbols
crates/edgen_server/src/error.rs22 symbols
crates/edgen_server/src/cli.rs21 symbols
docs/src/components/Search.tsx20 symbols
crates/edgen_server/src/util/perishable.rs17 symbols
crates/edgen_server/src/lib.rs17 symbols

For agents

$ claude mcp add edgen \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact