Skip to main content

Automated literature surveys


PyPI Status Code Coverage License LastCommit Contributor Covenant

Developer:

Getting Started

Get a Semantic Scholar API key

The first thing to do is to request an API key for Semantic Scholar. Note that this can only be used for research purposes. Here are some suggested answers for the form:

> How do you plan to use Semantic Scholar API in your project? (50 words or more)*

Generate literature surveys using large language models with relevant papers in context, using the `auto-survey` Python package. It re-writes the desired research topic into 10 different queries, pings the /paper/search endpoint for each of those for papers, and feeds those papers to a language model to generate a literature survey. It is only for my own private use.

> Which endpoints do you plan to use?

The /paper/search endpoint.

> How many requests per day do you anticipate using?

Around 100 requests per day.

When you have it, you create a file called .env in your current directory with the following content:

SEMANTIC_SCHOLAR_API_KEY="<your key here>"

If you already had a .env file, you can just append the line above to it.

Set up an LLM API key

Next, you need to set up an API key for the large language model (LLM) that you want to use. The default model is gpt-4.1-mini from OpenAI, which requires you to have an OpenAI API key, and again add it to your .env file:

OPENAI_API_KEY="<your key here>"

Installing and Running

Firstly, you need to install the pandoc and weasyprint packages, which allows for generating the final PDFs. You can do this on MacOS using Homebrew:

brew install pandoc weasyprint

On Ubuntu you can install them with apt:

sudo apt install pandoc weasyprint

Then, the easiest way to use the auto-survey package is as a uv tool. You can start generating a literature survey using the following command:

uvx auto-survey "<your topic here>"

This both installs the package and creates the literature survey, which typically takes about 10 minutes. With the default model, it costs about $0.05 per survey.

You can see all the available options by running the following command:

uvx auto-survey --help

Using Different Model Providers

The package supports all of LiteLLM's providers, including OpenAI, Anthropic, Google, xAI, local models, and more. You can simply set the --model argument to the model you want to use. For example, to use Claude Sonnet 4.5 from Anthropic, use

uvx auto-survey "<your topic here>" --model "claude-sonnet-4-5"

--model uses the same model for summarisation and writing. To choose different models, use --summarisation-model and --writing-model instead. --model cannot be combined with either role-specific option. The --temperature option controls the sampling temperature for all model calls and defaults to 1.0. LLM requests time out after 120 seconds by default and retry transient failures three times. For slow providers or long survey-writing requests, adjust these limits with --timeout-seconds and --num-retries:

uvx auto-survey "<your topic here>" --timeout-seconds 300 --num-retries 5

Some providers require you to prefix the model ID with the provider name. For instance, to use the Grok-3-mini model from xAI, you need to use

uvx auto-survey "<your topic here>" --model "xai/grok-3-mini"

All of this is documented in the LiteLLM provider documentation. If you use a different provider, you need to set different environment variables. See the LiteLLM provider documentation for more information on which environment variables to set.

Custom Inference API

You can use any OpenAI-compatible endpoint by setting --api-base to its base URL and prefixing each model ID with openai/:

uvx auto-survey "<your topic here>" \
  --model "openai/<model-id>" \
  --api-base "http://127.0.0.1:18080/v1"

When no API key is provided, Auto Survey sends a non-secret dummy key for compatibility with OpenAI clients. If a custom endpoint rejects optional parameters such as an output token limit or temperature, Auto Survey automatically retries without them for that model. If the endpoint requires authentication, store its API key in .env and pass the environment variable name with --api-key-env-var:

CUSTOM_LLM_API_KEY="<your key here>"

uvx auto-survey "<your topic here>" \
  --model "openai/<model-id>" \
  --api-base "https://example.com/v1" \
  --api-key-env-var "CUSTOM_LLM_API_KEY"

Other custom inference servers may require a different LiteLLM provider prefix. For example, vLLM uses hosted_vllm/ and Ollama uses ollama_chat/. See the LiteLLM provider documentation for the available prefixes.

Metadata

Release files for auto_survey 0.3.1

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

Source distribution (sdist)

Source distribution for auto_survey 0.3.1
File Size Uploaded
auto_survey-0.3.1.tar.gz 709.8 kB Details

Built distribution (wheel)

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

Total release size: 731.5 kB

Release files / auto_survey-0.3.1.tar.gz

Download URL auto_survey-0.3.1.tar.gz
Size 709.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9e173ca27c493360f4906f0e22f6bec029ec6ac603310ea12a2e884b6d2aede3
BLAKE2b-256 checksum
How to use checksums
47a91961e7022d17b50eca85b20b22d655f6e6131be22a63140a1ce1a893dba1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / auto_survey-0.3.1-py3-none-any.whl

Download URL auto_survey-0.3.1-py3-none-any.whl
Size 21.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cfddc6fd399a4e4818e218a5f2a485517944e00f01f6c77625b06e73e8c614a5
BLAKE2b-256 checksum
How to use checksums
e30fbf4ad78cb385af5e254289bf2e4cbf6c09db6f1f1463f985cfe8a082f051
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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