A gRPC service that matches natural language queries to API endpoints using embeddings and vector similarity search.
[Previous features section remains the same...]
[Previous architecture section remains the same...]
- Rust 1.70 or higher
- curl (for downloading models)
- gRPCurl (for testing gRPC endpoints)
- Docker (for server and development modes)
- At least 4GB of free disk space for models and Docker images
[Previous standalone mode section remains the same...]
# Build Docker image
docker build -t api-matcher .
# Run container
docker run -d \
--name api-matcher \
-p 50030:50030 \
-v api-matcher-data:/app/data \
-v $(pwd)/logs:/app/logs \
api-matcher
# Stop container
docker stop api-matcher
# Remove container
docker rm api-matcher
# Remove image
docker rmi api-matcher
# Stop all running containers
docker stop $(docker ps -a -q)
# Remove all stopped containers
docker rm $(docker ps -a -q)
# Clean up system (remove unused containers, networks, images)
docker system prune
# Remove everything (use with caution)
docker system prune -a
# View real-time logs
docker logs -f api-matcher
# Show last 100 lines with timestamps
docker logs -f -t --tail 100 api-matcher
# Save logs to file
docker logs api-matcher > matcher_logs.txt
# Run with persistent data and logs
docker run -d \
-p 50030:50030 \
-v api-matcher-data:/app/data \
-v $(pwd)/logs:/app/logs \
--name api-matcher \
api-matcher
# Check volume status
docker volume ls
# Check container status
docker ps
docker stats api-matcher
# Interactive shell access
docker exec -it api-matcher /bin/bash
# Check resource usage
docker stats
MODEL_VERSION
: Specify model version (default: paraphrase-multilingual-MiniLM-L12-v2)CONFIG_PATH
: Custom config file path (default: /app/endpoints.yaml)MODEL_PATH
: Custom model path (default: /app/models/multilingual-MiniLM)LOG_LEVEL
: Set logging level (default: info)
/app/data
: Vector database storage/app/logs
: Application logs/app/config
: Configuration files
# Start development environment
docker compose -f docker-compose.dev.yml up -d
# View logs in development
docker compose -f docker-compose.dev.yml logs -f matcher
# Stop development environment
docker compose -f docker-compose.dev.yml down
version: '3.8'
services:
matcher:
build:
context: .
target: development
volumes:
- .:/usr/src/app
- /usr/src/app/target
ports:
- "50030:50030"
environment:
- RUST_LOG=debug
command: cargo watch -x run -- --server
- Container won't start
# Check logs for errors
docker logs api-matcher
# Verify port availability
lsof -i :50030
# Check container status
docker ps -a
- Performance Issues
# Monitor resource usage
docker stats api-matcher
# Check available disk space
docker system df
- Clean Up Resources
# Remove unused resources
docker system prune
# Remove specific container and image
docker stop api-matcher && \
docker rm api-matcher && \
docker rmi api-matcher
# Manually download models
docker exec -it api-matcher bash
curl -L [model-url] -o [model-path]
# Verify model files
docker exec api-matcher ls -l /app/models/multilingual-MiniLM
- Minimum 2 CPU cores
- 4GB RAM
- 10GB disk space
- Docker 20.10 or newer
- Run container as non-root user
- Use Docker secrets for sensitive data
- Enable Docker content trust
- Regular security updates
# Basic health check
docker inspect api-matcher
# Resource monitoring
docker stats api-matcher
# Log monitoring
docker logs -f api-matcher
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- sentence-transformers for the embedding models
- LanceDB for the vector database
- tonic for the gRPC implementation