Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
804 changes: 804 additions & 0 deletions src/server/anthropic_translator.rs

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions src/server/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ pub fn create_app(state: AppState) -> Router {
get(routes::retrieve_response).delete(routes::delete_response),
)
.route("/v1/responses/:id/cancel", post(routes::cancel_response))
// Anthropic Messages API (/v1/messages surface).
.route("/v1/messages", post(routes::anthropic_messages))
.route(
"/v1/messages/count_tokens",
post(routes::anthropic_count_tokens),
)
// Issue #552: prompt-cache observability endpoints (always mounted —
// the handlers return a stable "disabled" payload when the cache is
// off so monitoring clients can poll without conditional logic).
Expand All @@ -118,6 +124,11 @@ pub fn create_app(state: AppState) -> Router {
get(routes::retrieve_response).delete(routes::delete_response),
)
.route("/responses/:id/cancel", post(routes::cancel_response))
.route("/messages", post(routes::anthropic_messages))
.route(
"/messages/count_tokens",
post(routes::anthropic_count_tokens),
)
// llama-server compatible endpoints
.route("/completion", post(routes::native_completion))
.route("/tokenize", post(routes::tokenize))
Expand Down
2 changes: 2 additions & 0 deletions src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

//! OpenAI/llama-server compatible HTTP server for mlxcel

pub mod anthropic_translator;
pub mod app;
pub mod batch;
mod chat_request;
Expand All @@ -33,6 +34,7 @@ pub mod speculative_dispatch;
mod startup;
mod state;
mod streaming;
pub mod streaming_anthropic;
pub mod streaming_responses;
pub mod structured;
pub mod thinking_budget;
Expand Down
Loading