Skip to main content

smolmodels ✨

PyPI version Discord

backed-by-yc

Build machine learning models using natural language and minimal code

Quickstart | Features | Installation | Documentation | Benchmarks


smolmodels lets you create machine learning models by describing them in plain language. Simply explain what you want, and the AI-powered system builds a fully functional model through an automated agentic approach.

Demo

1. Quickstart

Installation

pip install smolmodels

Two Ways to Use smolmodels

A. Interactive Chat Interface

Launch the interactive chat interface to build models through conversational AI:

# Start the chat interface
smolmodels

This opens a Gradio UI where you can describe your model, upload datasets, and get explanations throughout the process.

B. Library API

import smolmodels as sm

# Define the model
model = sm.Model(
    intent="Predict sentiment from news articles",
    input_schema={"headline": str, "content": str},
    output_schema={"sentiment": str}
)

# Build and train the model
model.build(
    datasets=[your_dataset],
    provider="openai/gpt-4o-mini",
    max_iterations=10
)

# Use the model
prediction = model.predict({
    "headline": "New breakthrough in renewable energy",
    "content": "Scientists announced a major advancement..."
})

# Save for later use
sm.save_model(model, "sentiment-model")
loaded_model = sm.load_model("sentiment-model.tar.gz")

2. Features

2.1. 💬 Natural Language Model Definition

Define models using plain English descriptions:

model = sm.Model(
    intent="Predict housing prices based on features like size, location, etc.",
    input_schema={"square_feet": int, "bedrooms": int, "location": str},
    output_schema={"price": float}
)

2.2. 🤖 Multi-Agent Architecture

The system uses a team of specialized AI agents to:

  • Analyze your requirements and data
  • Plan the optimal model solution
  • Generate and improve model code
  • Test and evaluate performance
  • Package the model for deployment

2.3. 🎯 Automated Model Building

Build complete models with a single method call:

model.build(
    datasets=[dataset],
    provider="openai/gpt-4o-mini",  # LLM provider
    max_iterations=10,              # Max solutions to explore
    timeout=1800                    # Optional time limit in seconds
)

2.4. 🎲 Data Generation & Schema Inference

Generate synthetic data or infer schemas automatically:

# Generate synthetic data
dataset = sm.DatasetGenerator(
    schema={"features": str, "target": int}
)
dataset.generate(500)  # Generate 500 samples

# Infer schema from intent
model = sm.Model(intent="Predict customer churn based on usage patterns")
model.build(provider="openai/gpt-4o-mini")  # Schema inferred automatically

2.5. 🌐 Multi-Provider Support

Use your preferred LLM provider:

model.build(provider="openai/gpt-4o-mini")    # OpenAI
model.build(provider="anthropic/claude-3-opus")  # Anthropic
model.build(provider="google/gemini-1.5-pro")    # Google

3. Installation

3.1. Installation Options

pip install smolmodels                  # Standard installation
pip install smolmodels[lightweight]     # Minimal dependencies
pip install smolmodels[all]             # With deep learning support

3.2. API Keys

# Set your preferred provider's API key
export OPENAI_API_KEY=<your-key>
export ANTHROPIC_API_KEY=<your-key>
export GEMINI_API_KEY=<your-key>

3.3. Command Line Interface

# Build a model
smolmodels build --intent "Predict customer churn" \
                 --dataset customer_data.csv \
                 --provider openai/gpt-4o-mini \
                 --output churn_model.tar.gz

# Make predictions
smolmodels predict churn_model.tar.gz --input-values usage=high spend=1200 tenure=24

# Show model details
smolmodels info churn_model.tar.gz

4. Documentation

For full documentation, visit docs.plexe.ai.

5. Benchmarks

Evaluated on 20 OpenML benchmarks and 12 Kaggle competitions, showing higher performance in 12/20 datasets. Full results at plexe-ai/plexe-results.

6. Docker Deployment

Deploy as a platform with API and web UI:

git clone https://github.com/plexe-ai/smolmodels.git
cd smolmodels/docker
cp .env.example .env  # Add your API key
docker-compose up -d

Access at:

  • API: http://localhost:8000
  • Web UI: http://localhost:8501

7. Contributing

See CONTRIBUTING.md for guidelines. Join our Discord to connect with the team.

8. License

Apache-2.0 License

Metadata

Release files for smolmodels 0.15.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for smolmodels 0.15.0
File Size Uploaded Provenance
smolmodels-0.15.0.tar.gz 86.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for smolmodels 0.15.0
File Interpreter ABI Platform
smolmodels-0.15.0-py3-none-any.whl Python 3 none any Details

Total release size: 219.5 kB

Release files / smolmodels-0.15.0.tar.gz

Download URL smolmodels-0.15.0.tar.gz
Size 86.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ade8a6fd89c2e354e529a7971792c9a40485c36747bac22eced230642d8e656e
BLAKE2b-256 checksum
How to use checksums
0efcee71ae8e8ee32a74f41ed067509ccc588d360b9a28a2c9c96ef5a3706c7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.2 CPython/3.12.10 Linux/6.8.0-1021-azure

Release files / smolmodels-0.15.0-py3-none-any.whl

Download URL smolmodels-0.15.0-py3-none-any.whl
Size 132.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c0df72053fa3553b43e7fa7142f2caa3bfb330480fbc43c9da701c193ff61a7f
BLAKE2b-256 checksum
How to use checksums
8d3feb5b67d1b9772834ff7ab6a6c75004c5cde8c17f4ce772109697314087b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.2 CPython/3.12.10 Linux/6.8.0-1021-azure

Security for smolmodels 0.15.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.15.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page