llm-registry-api 0.1.0

API layer for the LLM Registry - REST, GraphQL, and gRPC interfaces for model management
Documentation

LLM Registry API Layer

This crate provides the REST API layer for the LLM Registry using Axum. It includes request handlers, middleware, error handling, and response types.

Architecture

The API layer is organized into:

  • Handlers: Request handlers for all API endpoints
  • Routes: Route definitions and router configuration
  • Middleware: Tower middleware for logging, CORS, compression, etc.
  • Error Handling: Conversion of service errors to HTTP responses
  • Responses: Standard response wrappers and types

Example

use llm_registry_api::{build_router, AppState};
use llm_registry_service::ServiceRegistry;
use std::sync::Arc;

# async fn example(
#     services: ServiceRegistry,
# ) {
// Create application state
let state = AppState::new(services);

// Build router
let app = build_router(state);

// Run server (example)
// axum::Server::bind(&"0.0.0.0:3000".parse().unwrap())
//     .serve(app.into_make_service())
//     .await
//     .unwrap();
# }