mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-05-24 22:15:18 +00:00
- Export training module and types from lib.rs (TrainingConfig,
TrainingDataset, Trainer, TrainingMetrics, generate_teacher_predictions)
- Export RouterConfig and FastGRNNConfig from lib.rs
- Add From<std::io::Error> impl for TinyDancerError
- Update examples to work without external dependencies:
- admin-server.rs: Simplified to demonstrate health checks and
config inspection without axum/tokio
- full_observability.rs: Uses manual metrics tracking instead of
prometheus crate
- metrics_example.rs: Manual metrics collection and display
- tracing_example.rs: Simple timing-based example without
OpenTelemetry
Fixes #16
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| admin-server.rs | ||
| full_observability.rs | ||
| metrics_example.rs | ||
| OBSERVABILITY_EXAMPLES.md | ||
| README.md | ||
| tracing_example.rs | ||
| train-model.rs | ||
Tiny Dancer Examples
This directory contains example applications demonstrating how to use Tiny Dancer.
Admin Server Example
File: admin-server.rs
A production-ready admin API server with health checks, metrics, and administration endpoints.
Features
- Health check endpoints (K8s liveness & readiness probes)
- Prometheus metrics export
- Hot model reloading
- Configuration management
- Circuit breaker monitoring
- Optional bearer token authentication
Running
cargo run --example admin-server --features admin-api
Testing
Once running, test the endpoints:
# Health check
curl http://localhost:8080/health
# Readiness check
curl http://localhost:8080/health/ready
# Prometheus metrics
curl http://localhost:8080/metrics
# System information
curl http://localhost:8080/info
Admin Endpoints
Admin endpoints support optional authentication:
# Reload model (if auth enabled)
curl -X POST http://localhost:8080/admin/reload \
-H "Authorization: Bearer your-token-here"
# Get configuration
curl http://localhost:8080/admin/config \
-H "Authorization: Bearer your-token-here"
# Circuit breaker status
curl http://localhost:8080/admin/circuit-breaker \
-H "Authorization: Bearer your-token-here"
Configuration
Edit the example to configure:
- Bind address and port
- Authentication token
- CORS settings
- Router configuration
Production Deployment
For production use:
-
Enable authentication:
auth_token: Some("your-secret-token".to_string()) -
Use environment variables:
let token = std::env::var("ADMIN_AUTH_TOKEN").ok(); -
Deploy behind HTTPS proxy (nginx, Envoy, etc.)
-
Set up Prometheus scraping:
scrape_configs: - job_name: 'tiny-dancer' static_configs: - targets: ['localhost:8080'] -
Configure Kubernetes probes:
livenessProbe: httpGet: path: /health port: 8080 readinessProbe: httpGet: path: /health/ready port: 8080
Documentation
Next Steps
- Integrate with your application
- Set up monitoring (Prometheus + Grafana)
- Configure alerts
- Deploy to production
Support
For issues or questions, see the main repository documentation.